Some questions about Barba.js
See original GitHub issueHello !
I’m diving into Barba.js from 2 weeks, I really like it ! It’s fast and more reactive than my homemade system with Pjax.js ^^ I read the docs, I read a part of the source code and a lot of GtHub Issues/Questions.
However there are still some things I do not know how to do, or even how to start 😄 (I’m using it on Wordpress btw)
-
I defined a custom transition
pagesTransition
for every pages, it animates title / thumbnail and content with GSAP. But if I want to have a custom transition when i land on the “portfolio” page ? (I want thepagesTransition
effects when i leave from any pages, and custom ones when i come to portfolio page). I Used yourvalid()
logic from #19 but if i’m doing this, i have to copy the effects frompagesTransition
toToPortfolio
transition ? I must doing something wrong 😄 This leads to my second question ^^ -
Can we share components between differents transition ? If i want to create a new custom transition to display a masonry, and i want to preload it. Can we have a component or method
preloadImages
shared between transitions ? -
Finally, How do you manage the first full load from the pjax loads between pages ? (to init scrits). I mean, if i want the sames effects i set up in my transitions when i land on the site ?
That’s all 😄 Thanks for reading ^^ And thanks for Barba.js 👍
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
No problems 😃 thanks to take the time to answer 😄
Okay, Interesting, In your demos, you never call
Barba.Pjax.start()
I was wondering what it was for ^^. So if i put the pages GSAP effects ininitStateChange
ornewPageReady
, they will be rendered at the first load ? But after each page changed as well ? What do you recommend then ?It’s never too late @mikdlawregiets ! many thanks for the answer, i’ll give it a try 🙌