2013-07-14 126 views
-2

我想在我的網頁左側滑出選項卡,但它在頁面中以「跳動」效果滑動,並通過另一種效果(如「剪輯」)滑動,但我不知道怎麼做?如何創建幻燈片選項卡

+4

你能告訴我們你現在試過自己麼? – m90

回答

0

使用jQuery,這個例子滾動div時用戶不會看到任何的div更多:

//scrolling the output_code div to my view 
$(window).scroll(function() { 
    var set1 = $(document).scrollTop(); 
    var p = $("#output_code").position(); 

    if((set1 - p.top > 150)||(set1 - p.top < -700)){ 
     $('#output_code').animate({top:set1 + "px"},{duration:500,queue:false}); 
    } 
}); 
如果你只想滾動這一切的時候

//scrolling the output_code div to my view 
$(window).scroll(function() { 
    var set1 = $(document).scrollTop(); 
    var p = $("#output_code").position(); 
    $('#output_code').animate({top:set1 + "px"},{duration:500,queue:false}); 

}); 

課程將#output_code更改爲您的div ID。 GoodLuck!

0

看來你想要像使用.animate().effect()tab s。

.animate() 

.effect() 

退房jQuery的UI這樣:http://jqueryui.com/effect/。 但是,如果您沒有向我們展示任何code,我們也幫不了你。