I have a panel with links like this
Page1
Page2
Page3
If I am currently on Page1 and open the panel, the panel i
You do something like this
$(document).on("pageinit", function () {
$("[data-role=panel] a").on("click", function () {
if($(this).attr("href") == "#"+$.mobile.activePage[0].id) {
$("[data-role=panel]").panel("close");
}
});
});
Update: For jQM >= 1.4 use $.mobile.pageContainer.pagecontainer("getActivePage")
instead of $.mobile.activePage
.
Demo: http://jsfiddle.net/Palestinian/k89A5/1/