2011-10-27 80 views

回答

1

在您的演示中進行以下更改。

在CSS:

#content { 
    padding: 0px; 
    margin: 0 auto; 
    margin-top:200px; 
    width: 700px; 
    text-align:left; 
    z-index:1; 
    position: relative; 
} 

#layout { 
    width: 700px; 
    position:absolute; 
} 

完整的JS文件:

<!-- Function --> 
var positionClosed = 0; // the vertical position of the title when minimized 
$(function(){ 
    positionClosed = $(window).height() - // window size 
    $('#footer').height() - // footer size 
    $('#content').css('margin-top').replace('px', '') - // margin from top 
    $('.trigger').height() - // title size 
    20; // a little margin 

    $("#content").css('top', positionClosed); 
    $('.toggle_container').hide(); 

    $(".trigger").click(function(){ 
    $(this).toggleClass("active").next().slideToggle("slow"); 
    if(!$(this).hasClass('active')) 
     $('#content').animate({top: 0}, 'slow'); 
    else 
    $('#content').animate({top: positionClosed}, 'slow'); 
    }); 
}); 
1

您在CSS文件中使用position:fixed頁眉和頁腳bottom:0px頁腳和top:0px爲頭。

+0

我有一個嘗試的提及,但在這裏沒有使用的是演示鏈接@ http://bit.ly/vy0lO5時內容隱藏標題應該順利地走到頁面底部... –