Scrollify icon indicating copy to clipboard operation
Scrollify copied to clipboard

Height or offset not properly set in WP

Open danyj opened this issue 6 years ago • 2 comments

This is WordPress specific issue but since I am making a theme for users there will be many of them asking to fix it.

When admin is logged in the #wpadminbar is enabled and the heights are off by 32px beacuse of the WP html 32px top margin.

I tried to play with offset , setting setHeights to false but it is either off on first section or correct on first and off on all others.

See this please http://take.ms/4xMay

Any help is appreciated!

danyj avatar Jul 28 '18 20:07 danyj

This is the issue https://github.com/lukehaas/Scrollify/blob/master/jquery.scrollify.js#L658

the first section position is not taking possible html top spacing margin/padding

if I do

heights[i] = parseInt($this.offset().top - 32);

the first section is scrolled to properly onload when WP admin bar is visible

danyj avatar Jul 30 '18 01:07 danyj

@danyj hey dude, I managed to get this resolved by checking for the admin bar and applying the difference only if the admin bar is present.

Please review my screenshot and let me know if it works for you as well. screen shot 2018-09-20 at 11 51 16 am

jferragut avatar Sep 20 '18 15:09 jferragut