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 collapsibles 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 }); 

jsfiddle


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -