开发者

jQuery Tools :: Add Scrollable dynamically

I'm having trouble adding scrollable to a dynamically generated div.

$(".feedPane").scrollable({items: '.feedItems', vertical: true, mousewheel: true});

This works fine with static divs but once I created another one it doesn't work for it.

So, how do you create scrollable for dynamic elements?

开发者_如何学C

edit: What solved the problem is creating new dynamic scrollable with a different id. I can only contemplate the reason - probably a clash with the first scrollable defined.


Since your dynamically created div wasn't around when you added scrollable to the objects with class feedPane, it didn't get scrollable called on it. To fix this you will have to call scrollable on the div after you create it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜