2

I have a scrollable div in my page. The container div has its min-height set to some value. And I want the item in the scrollable can be shown/hidden. It means that the height of the scrollable is not fixed. When the item is shown, the height of the scrollable should also change to longer. But this is not working. When the item is shown, the scrollable does not become longer which makes the shown item not completely shown.

I think it has something to do with the scrollable plugin. But I cannot figure out why. Anyone help?

4

1 回答 1

4

使用可滚动事件

例子

$("#flowpanes").scrollable({ 
    circular: true, 
    mousewheel: false, 
    onBeforeSeek: function(evt, index){
        $('#flowpanes').stop().animate({ height: $('.item').eq(index+1).height()+'px'}, 250);
    }
})

您需要将 1 添加到索引,因为 Scrollable 会克隆第一个和最后一个项目。

于 2011-01-07T23:53:08.270 回答