Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fuyangli
Copy link

$('.parallax').scrolly({bgParallax: true, horizontalPos: '100%'});

$('.parallax').scrolly({bgParallax: true, horizontalPos: '100%'});
Using jquery scroll event (so it starts only when it really scrolled) and adjusting image on page refresh (before, we need to scroll something to adjust the initial position of the image)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think bind is deprecated, no? Maybe I'm wrong, but we should try to use on instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you're right!
As seen in http://stackoverflow.com/questions/11847021/jquery-bind-vs-on, bind maps to on, but will be deprecated!

Bind will be deprecated, so use on instead.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that on purpose. See http://joshbroton.com/hooking-up-to-the-window-onscroll-event-without-killing-your-performance/

The performance are still bad. If I want to re-write this plugin I'll use requestAnimationFrame which is way better https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants