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

Change scrollOffset after init #77

Closed
wackazong opened this issue Dec 3, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@wackazong
Copy link

commented Dec 3, 2013

Hello, how would I changed the scrollOffset after I initialized a onePageNav object?

Thanks, ALEXander.

@davist11

This comment has been minimized.

Copy link
Owner

commented Dec 3, 2013

What do you need to change the scrollOffset for? It's actually being deprecated in the next version.

@wackazong

This comment has been minimized.

Copy link
Author

commented Dec 3, 2013

First, I was curious how to do it :) I thought would be a good JS exercise and I did not manage.

Second, I have a wordpress theme with your plugin built in and I do not want to change the theme code itself.

I saw that the offset will be deprecated. What about a situation where I do want to scroll to a specific div, but always 100px above? Would that be possible in the new version?

@davist11

This comment has been minimized.

Copy link
Owner

commented Dec 3, 2013

You would use a negative top margin and top padding. You can see it in this example: https://github.com/davist11/jQuery-One-Page-Nav/blob/rewrite-for-v3/top.html

.section {
        margin-top: -30px;
        padding-top: 30px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.