I have a floating box on one of my pages that "parks" itself at the header so it does not cover it. Once you scroll down, it follows the screen. I now want it to park at the footer so it doesn't cover the footer. It should work similarly to the one on google video: http://video.google.com/videosearch?q=video&hl=en&emb=0&aq=f# Here is the script we use to park the box at the top. It would be great if it could be modified to work for the footer. <script type="text/javascript"> window.onload = function( ){ $( window ).scroll( function( ){ var scroller_object = $( "#flybox" ); if( document.documentElement.scrollTop >= 287 || window.pageYOffset >= 287 ) { if( $.browser.msie && $.browser.version == "6.0" ) { scroller_object.css( "top", ( document.documentElement.scrollTop + 8 ) + "px" ); } else { scroller_object.css( { position: "fixed", top: "8px" } ); } } else if( document.documentElement.scrollTop < 287 || window.pageYOffset < 287 ) { scroller_object.css( { position: "absolute", top: "420px" } ); } } ); }</script> Code (markup):
Try this <script type="text/javascript"> window.onload = function( ){ $( window ).scroll( function( ){ var scroller_object = $( "#flybox" ); if( document.documentElement.scrollBottom >= 287 || window.pageYOffset >= 287 ) { if( $.browser.msie && $.browser.version == "6.0" ) { scroller_object.css( "Bottom", ( document.documentElement.scrollBottom + 8 ) + "px" ); } else { scroller_object.css( { position: "fixed", Bottom: "8px" } ); } } else if( document.documentElement.scrollBottom < 287 || window.pageYOffset < 287 ) { scroller_object.css( { position: "absolute", Bottom: "420px" } ); } } ); }</script> Code (markup):