Dynamic collapsible动态加载collapsible

js:
$(document).on("pageinit", function() {
    var nextId = 1;
    $("#add").click(function() {
        nextId++;
        var content = "

Section " + nextId + "

I am the collapsible content in a set so this feels like an accordion. I am hidden by default because I have the 'collapsed' state; you need to expand the header to see me.

"; $("#set").append( content ).collapsibleset('refresh'); }); $("#expand").click(function() { $("#set").children(":last").trigger( "expand" ); }); $("#collapse").click(function() { $("#set").children(":last").trigger( "collapse" ); }); });
html:



Section 1

I'm the collapsible content.


具体查看: http://demos.jquerymobile.com/1.3.1/examples/collapsibles/dynamic-collapsible.html#&ui-state=dialog

 
 

你可能感兴趣的:(jquery,mobile,jquery,mobile,collapsible)