GithubHelp home page GithubHelp logo

Issues with Turbolinks about scrollme HOT 8 CLOSED

nckprsn avatar nckprsn commented on June 9, 2024
Issues with Turbolinks

from scrollme.

Comments (8)

nckprsn avatar nckprsn commented on June 9, 2024

Did a quick search: https://github.com/kossnocorp/jquery.turbolinks sounds like it should solve the problem.

I've never worked with Turbolinks but my understanding is that it can easily break a lot of jQuery plugins that rely on certain events to initialise. If the above doesn't work then some changes to ScrollMe's event bindings may be required.

from scrollme.

chrise86 avatar chrise86 commented on June 9, 2024

I'm already using that :(—
Sent from Mailbox

On Tue, Jun 17, 2014 at 5:58 PM, Nick Pearson [email protected]
wrote:

Did a quick search: https://github.com/kossnocorp/jquery.turbolinks sounds like it should solve the problem.

I've never worked with Turbolinks but my understanding is that it can easily break a lot of jQuery plugins that rely on certain events to initialise. If the above doesn't work then some changes to ScrollMe's event bindings may be required.

Reply to this email directly or view it on GitHub:
#3 (comment)

from scrollme.

nckprsn avatar nckprsn commented on June 9, 2024

Bit of a stab in the dark here - can you try replacing line 374:

$document.ready( function(){ init(); } );

with this:

$document.on( 'ready page:load' , function(){ init(); } );

And let me know if that works?

I realise this probably isn't the right way to do this - am still a bit of a noob with GitHub!

from scrollme.

chrise86 avatar chrise86 commented on June 9, 2024

That seems to solve the first issue!

Still doesnt want to work when hitting that back button though... I'll see if I can do some digging too 😄

from scrollme.

chrise86 avatar chrise86 commented on June 9, 2024

Ok this works:

$document.on( 'ready page:load page:change' , function(){ init(); } );

So, it has to trigger on page:load as normal (incase animation is on the start page), and has to trigger on page:change incase the page has changed to a cached version.

Seems to be the only combo that worked for me... although I could swap either for one or two other event names, but it would still require 2 calls each time...

from scrollme.

nckprsn avatar nckprsn commented on June 9, 2024

That makes perfect sense.

I'm tempted to include as you've put it but I'm a little unsure about the consequences of attempting to bind to non-existent events.

from scrollme.

chrise86 avatar chrise86 commented on June 9, 2024

Maybe a new branch? :)—
Sent from Mailbox

On Thu, Jun 19, 2014 at 6:55 PM, Nick Pearson [email protected]
wrote:

That makes perfect sense.

I'm tempted to include as you've put it but I'm a little unsure about the consequences of attempting to bind to non-existent events.

Reply to this email directly or view it on GitHub:
#3 (comment)

from scrollme.

nckprsn avatar nckprsn commented on June 9, 2024

Rather than make a new branch I've added an array of events to bind the init() to so other can easily be added in future if need be. (http://xkcd.com/974/ ...)

As far as I can tell, if the event handler doesn't exist the binding will take place but the event will of course never be fired. Therefore, this shouldn't impact any cases where Turbolinks isn't present. Any further enlightenment on the topic would be most welcome!

from scrollme.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.