jQuery-One-Page-Nav icon indicating copy to clipboard operation
jQuery-One-Page-Nav copied to clipboard

Offset differences in Chrome and Firefox.

Open Hova10 opened this issue 11 years ago • 4 comments

So i'm using a fix navbar, so i had to put an offset so that when the user clicks on one of the nav's buttons the header of that section doesn't get covered by the navbar. It works perfectly on chrome, but on firefox it's as if it isn't recognising the offset. You can see for yourself on my WiP:

http://www.opinatus-solutions.com/

All i did was add an offset of 64px by editing line 205 of the Js file:

$('html, body').animate({ scrollTop: offset - 64 }, this.config.scrollSpeed, this.config.easing, callback); },

Is there a way i can make this work on firefox as well?

Hova10 avatar Jun 15 '14 18:06 Hova10

I'm confused, you edited the plugin directly?

davist11 avatar Jun 17 '14 22:06 davist11

The firefox browser jumps to the section when one clicks the links. This is done after the plugin does its job. The simplest way is to disable hashChange i.e

hashChange: fasle

This can be added to the plugin for a fix http://stackoverflow.com/questions/3870057/how-can-i-update-window-location-hash-without-jumping-the-document

timwax avatar Jul 09 '14 17:07 timwax

Was having the same issue as the OP of this thread. Editing line 205 worked for me also, just needed to adjust the offset a bit. Fixed headers seem to bug this plugin just a touch. Would be nice to add an option you could use when initializing the plugin that would allow to adjust the offset.

andywarren avatar Sep 18 '14 15:09 andywarren

+1 for an option to adjust the offset, heaving the same issue with fixed navbar

ivansammartino avatar Jan 12 '16 23:01 ivansammartino