JavaScript Programming JavaScript > Code Examples Add section to SectionStack Add section to SectionStack <HTML><HEAD> <TITLE>Happy Codings :-) JavaScript - Learn Web Development</TITLE> </HEAD><BODY BGCOLOR='silver'> <SCRIPT> isc.SectionStack.create({ ID: "sectionStack", visibilityMode: "multiple", width: 300, height: 500, sections: [ {title: "Blue Pawn", expanded: true, items: [ isc.Label.create({contents: "Happy Codings :-) "}) ]}, {title: "Green Cube", expanded: true, canCollapse: false, items: [ isc.Label.create({contents: "Happy Codings :-) "}) ]}, {title: "Blue Cube", expanded: false, items: [ isc.Label.create({contents: "Happy Codings :-) "}) ]} ] }); isc.IButton.create({ left: 325, width: 150, title: "Add Section", click: function () { // alternate adding yellow piece and blue cube if (sectionStack.sections.length % 2 == 1) { sectionStack.addSection({ title: "Yellow Piece", expanded: true, items: [ isc.Label.create({contents: "Happy Codings :-) "}) ] }); } else { sectionStack.addSection({ title: "Blue Cube", expanded: false, items: [ isc.Label.create({contents: "Happy Codings :-) "}) ] }); } } }); </SCRIPT> </BODY> </HTML>