Skip to content

Conversation

@mphasize
Copy link

Breaking Change:
Modified the topOffset option to accept an object with { val : 0 }. The way Javascript works, this enables us to keep a variable outside of scrollIt like this:

var topOffset = {
  val: -30
}

$.scrollIt({
  topOffset : topOffset
});

topOffset.val = -90; // scrollIt will now use updated topOffset

This modification is pretty useful, when you want to create responsive layouts in combination with scrollIt.

Second change: I added a function to remove the scrollIt event handlers. This is quite useful when building a single page app or using frameworks like Ember, so that you can cleanly remove scrollIt and re-initialize it when you move around the page.

Use $.scrollIt.destroy()

Cheers!

…that object’s properties so we can adjust the offsetTop nicely in responsive layouts. Yeah! :-)
…t.listeners object to expose event handlers.
Using an object for topOffset we can change that value during the page views lifecycle, which makes responsive webdesigns a little easier.
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.

1 participant