cmpolis/scrollIt.js

Help with passing in custom option

Opened this issue · 1 comments

Hi, this is an awesome plugin and is working great! I am fairly new at using jQuery and was somewhat confused on how to pass in a custom value for the topOffset.

I know this is not right because it isn't working, any assistance would be appreciated. Thanks

section data-scroll-index='1' data-topOffset="60"

It seems like you've put data-topOffset="60" into the html, that's not how it works.

$.scrollIt({
upKey: 38, // key code to navigate to the next section
downKey: 40, // key code to navigate to the previous section
easing: 'linear', // the easing function for animation
scrollTime: 600, // how long (in ms) the animation takes
activeClass: 'active', // class given to the active nav element
onPageChange: null, // function(pageIndex) that is called when page is changed
topOffset: 0 // offste (in px) for fixed top navigation
});

You should put this options section into your <script></script> or js file.

And just simply change the last option: topOffset:0 to something you want.