Advertisement
Guest User

Untitled

a guest
May 8th, 2011
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*Scroll*/
  2.  
  3. var timer = 0;
  4. var $top= $('#myFloater').offset().top + 20; //add additional necessary offset for Webkit
  5.  
  6. jQuery(window).scroll(function()  
  7. {  
  8.   if (!timer) {
  9.     timer = setTimeout(function(){
  10.  
  11.       var topOfWindow = $(window).scrollTop(); //
  12.      
  13.         if (topOfWindow > $top)
  14.             {  
  15.             $('#myFloater').css({
  16.               position: 'absolute'});
  17.             $('#myFloater).stop(true, true).animate({
  18.                opacity: 0.75,
  19.                width: 40,
  20.                top: topOfWindow,
  21.                right: -25
  22.                }, 600, 'easeOutElastic' );
  23.            }
  24.            else  
  25.            {  
  26.            $('#myFloater').stop(true, true).css({
  27.                opacity: 1,
  28.                width: 270,
  29.                top: 0,
  30.                right: 0,
  31.                position: 'relative'
  32.                });  
  33.            }  
  34.  
  35.          timer = 0;
  36.    }, 250);        
  37.  };  
  38. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement