Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Scroll*/
- var timer = 0;
- var $top= $('#myFloater').offset().top + 20; //add additional necessary offset for Webkit
- jQuery(window).scroll(function()
- {
- if (!timer) {
- timer = setTimeout(function(){
- var topOfWindow = $(window).scrollTop(); //
- if (topOfWindow > $top)
- {
- $('#myFloater').css({
- position: 'absolute'});
- $('#myFloater).stop(true, true).animate({
- opacity: 0.75,
- width: 40,
- top: topOfWindow,
- right: -25
- }, 600, 'easeOutElastic' );
- }
- else
- {
- $('#myFloater').stop(true, true).css({
- opacity: 1,
- width: 270,
- top: 0,
- right: 0,
- position: 'relative'
- });
- }
- timer = 0;
- }, 250);
- };
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement