Determine Active Panel

雨燕双飞 提交于 2020-01-03 03:17:25

问题


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.


回答1:


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

if( $($.ui.activeDiv).prop("id") == "someId" )
        //do something.



回答2:


Or you just can do this

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



来源:https://stackoverflow.com/questions/16492193/determine-active-panel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!