Skip to content
This repository has been archived by the owner on Jun 9, 2021. It is now read-only.

How to set the offset without editing jquery.nav.js? #162

Closed
Alecto opened this issue Jun 29, 2017 · 5 comments
Closed

How to set the offset without editing jquery.nav.js? #162

Alecto opened this issue Jun 29, 2017 · 5 comments

Comments

@Alecto
Copy link

Alecto commented Jun 29, 2017

I need 40px offset from top.
Is there any way to customize this option?
Something like this
$('#navbar').onePageNav({
'scrollOffset': 117
});

@davist11
Copy link
Owner

Check out this demo

http://davist11.github.io/jQuery-One-Page-Nav/top.html

@Alecto
Copy link
Author

Alecto commented Jun 29, 2017

I can not use margin-top, this is not allowed in the design.
As a result, the menu closes part of the section.
The ideal way is to offset, but for this i need to edit the library.

@davist11
Copy link
Owner

It has zero impact on the design if you use a negative top margin and top padding.

@Alecto
Copy link
Author

Alecto commented Jun 29, 2017

I've already tried it.
As I said, this method can not be applied, because in the design of the sections, template have different predefined indents, changing which is prohibited design requirements.
Why do not you want to add this option to the plugin? Because I'm not the first one to whom this option is necessary.

@davist11
Copy link
Owner

I'm not sure what predefined indents means. I do not want to add it back to the plugin because it is more complexity to add, you can't change the value across sections, and you can't adjust it responsively. Using a CSS approach simplifies and solves all of this easily.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants