pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: https://www.noaa.gov/themes/custom/noaa_guswds/js/noaa/sticky-top.js?sk32m1

pse otherwise. //when wrapper collapses it can cause the page to be shorter and hit the "sticky point" causing the page to jump down //and you can never actually scroll to the top stickyElementWrapper.css('height' , stickyElementWrapper.outerHeight()); $(window).scroll(function(){ //check for visibility, when blind is open element gets set to sticky and a width of 0 otherwise if (stickyElement.is(':visible')) { setFixed(); } if (stickyElement.hasClass('fixed') && stickyElement.is(':visible')) { setWidth(); setLeft(); } }); $(window).resize(function(){ //when resizing the window the element may go above the page top setFixed(); if (stickyElement.hasClass('fixed')) { //on resize keep the fixed element same width as parent setWidth(); //since the left position is set after the menu closes we must update the left pos on resize setLeft(); } else { stickyElement.width(''); } }); //this event haapens in menu.js when the menu closing animation is finished after window load $(document).on('menuMoved', function() { setLeft(); }); function setWidth() { var stickyElementWrapperWidth = stickyElementWrapper.outerWidth(); stickyElement.width(stickyElementWrapperWidth); } function setLeft() { var leftPos = stickyElementWrapper.offset().left + 'px'; stickyElement.css('left' , leftPos); } function setFixed() { //if element goes above page top set it to fixed. //if it goes below unset fixed position var windowTop = $(window).scrollTop(); var elementTop = stickyElementWrapper.offset().top; if (windowTop >= elementTop) { stickyElement.addClass('fixed'); //once its fixed the width changes because it no longer has the same parent, so set the width to the parent width; stickyElement.width(stickyElementWrapperWidth); } else { stickyElement.removeClass('fixed'); } } } } })(jQuery, Drupal); pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy