Possible Duplicate:
Dynamically adding collapsible elements
I would like to know how I could dynamically add a collapsible div, such a thing can be done with Jqm listviews, calling lisview(‘refresh’) after
here is the testing code:
http://jsfiddle.net/ca11111/UQWFJ/5/
edit: in above, it’s appended and rendered, but multiple times
edit2: seems working like this?
How about omitting the
refreshsince you are initializing the element (not refreshing it):Here is an updated version of your JSFiddle: http://jsfiddle.net/UQWFJ/7/ (Notice I changed your
setTimeoutto asetIntervalto continuously add new elements to the DOM)Also you could optimize this by saving the new element in a variable so you can call
.collabsible()on just that element:Here is a JSFiddle with this optimization: http://jsfiddle.net/UQWFJ/9/