Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help with passing in custom option #40

Open
dronettdevin opened this issue Feb 22, 2015 · 1 comment
Open

Help with passing in custom option #40

dronettdevin opened this issue Feb 22, 2015 · 1 comment

Comments

@dronettdevin
Copy link

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"

@BigShaw
Copy link

BigShaw commented May 7, 2015

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.

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

No branches or pull requests

2 participants