开发者

jQuery Tools :: Add Scrollable dynamically

开发者 https://www.devze.com 2023-03-01 11:14 出处:网络
I\'m having trouble adding scrollable to a dynamically generated div. $(\".feedPane\").scrollable({items: \'.feedItems\', vertical: true, mousewheel: true});

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

精彩评论

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