eduardomb / scroll-up-bar

The scroll up bar plugin (jQuery) hides the top bar when scrolling down, and show it when scrolling up. It's specially useful on mobile interfaces to save some precious space.
MIT License
612 stars 63 forks source link

wordpress admin bar #24

Open enkhtulga opened 8 years ago

enkhtulga commented 8 years ago

I have implemented this scripts on wordpress but Wordpress admin bar has displayed and i need to calculate it while scrolling up.

If scrolling up works then it has not included wordpress admin bar height. How to include it?

Sorry for my bad english, I hope you understand.

Thanks for your help?

Kimzi commented 8 years ago

Hi!

On line 59 I changed this : if (y >= minY) { $bar.css({ 'position': 'fixed', 'top': 0 }); }

To this : if (y >= minY) { if ($("body").hasClass("admin-bar")) { $bar.css({ 'position': 'fixed', 'top': 32 }); } else { $bar.css({ 'position': 'fixed', 'top': 0 }); } }

The only issue I've got now though is scrolling down is a lil buggy, don't know how to fix that yet. Think I need to specify the extra margin somewhere.