Determine Active Panel

2019-06-06 11:38发布

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.

2条回答
你好瞎i
2楼-- · 2019-06-06 11:51

Or you just can do this

$.ui.activeDiv.id == "contents01";

查看更多
Luminary・发光体
3楼-- · 2019-06-06 11:58

This is how i get the ID, I am just wrapping it in a jqMobi object:

if( $($.ui.activeDiv).prop("id") == "someId" )
        //do something.
查看更多
登录 后发表回答