1

In a page with vertically stacked sections, one of these sections contains a jquery accordion.

example

The first accordion UL (green in picture) is $(window).height()-ConstantPixels, so that the accordion takes 100% of the available height. (red box represents browser window). Which means that sometimes a part of it will ne hidden.

So what i'm trying to accomplish is to start increasing the green UL's height when scrolling down, until all green content is visible. Any suggestions? thank you

4

2 回答 2

2

如果您分享一些代码,我可能会提供更好的帮助,但这是一般的想法。

您可以监听浏览器的滚动事件,并为该特定 div 动态设置高度。像这样的东西:

$(document).scroll(function(e){
    var currentHeight = $('#greendiv').height();
    $('#greendiv').height(currentHeight + $(document).scrollTop());
});

类似的东西。那是你要找的吗?

于 2013-05-03T08:06:38.007 回答
0
var no=1,new= $('#div').height();
$(window).scroll(function () {
    if(no==1)
    {
        if ($(window).height() + $(window).scrollTop() == $(document).height()) {
            no=2;
            $.ajax({
                type: "POST",
                url: "request.php",
                data: datas,
                cache: false,
                success: function(html){
                   $('#div').height($(document).height()+new);
                }
            });
        }
    }
});
于 2013-05-03T08:10:59.330 回答