2013-09-26 41 views
1

我想創建一個圖像900px滾動後,顯示卻隱藏着隱藏時,它已經達到了700像素jQuery的顯示和滾動

它的工作原理上向下滾動,但是當林不知道如何經過一定隱藏關於像素的數量

這是我的代碼。

$(document).scroll(function() { 
    var y = $(this).scrollTop(); 
    if (y > 900) { 
     $('.bottom-signup').fadeIn(1000); 
    } else { 
     $('.bottom-signup').fadeOut(700); 
    } 

}); 

謝謝你們 看到演示

http://jsfiddle.net/uhUWC/

回答

0

試試這個,如果我正確了你的問題。

$(document).scroll(function() { 
    var y = $(this).scrollTop(); 
    if (y > 700 && y<900) { 
     $('.bottom-signup').fadeIn(1000); 
    } 
    else { 
     $('.bottom-signup').fadeOut(700); 
    } 

}); 
+0

感謝您的幫助,我創建了一個小提琴,按鈕消失,當你停止滾動,我需要它停下來,然後消失在向上滾動http://jsfiddle.net/uhUWC/ –

+0

你想什麼去做 ?也請查看這篇文章http://codewithlogic.wordpress.com/2013/09/01/smooth-scrolling-effect-in-javascript-using-jquery/ – Arpit

+0

我試圖創建這個http://www.flickr.com/在底部滾動並彈出? –