Buying Simple Floating Script - EASY $20

Discussion in 'Programming' started by Checkmait, Sep 30, 2009.

  1. #1
    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):
     
    Checkmait, Sep 30, 2009 IP
  2. G705

    G705 Active Member

    Messages:
    113
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    60
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    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):
     
    G705, Sep 30, 2009 IP