I'm on a phonegap project.
I do my project with JQMobi (new name is Intel's App Framework)..
On this project i want to determine the visible/active panel to startup my functions according to it.
Here is what i've tried ;
$(document).bind('pageshow', function () {
var id = $.ui.activeDiv[0].id;
if ($.ui.activeDiv[0].id=="contents01"){
getLive();
}
});
function getLive(){
alert('on live page!');
}
how can i do this in jqmobi/app framework ?
i used this in jquery mobile and it was working.
$(document).bind('pageshow', function () {
var id = $.mobile.activePage[0].id;
if (id=="home"){
getHomePage();
}
else.....
Waiting your answers.
Thanks.
This is how i get the ID, I am just wrapping it in a jqMobi object:
if( $($.ui.activeDiv).prop("id") == "someId" )
//do something.
Or you just can do this
$.ui.activeDiv.id == "contents01";
来源:https://stackoverflow.com/questions/16492193/determine-active-panel