cordova - jQuery Mobile Collapsible set, How to check which collapsible element is expanded? -
i have dynamically created collapsible set. need find out element expanded in collapsible set.
if list, can obtain clicked list element this,
$('ul').children('li').on('click', function () { name = $.trim($(this).text()); });
how can collapsible set?.
thanks:)
you can use expand
, collapse
events on collapsible
s constitute collapsible-set
$(document).on("expand", "div[data-role=collapsible-set] div[data-role=collapsible]", function(){ var title = $(this).find(".ui-btn-text") .contents() .filter(function(){ return this.nodetype == 3; }).text(); alert("expanded: " + title); }); $(document).on("collapse", "div[data-role=collapsible-set] div[data-role=collapsible]", function(){ // code goes here });
Comments
Post a Comment