开发者

How can i see what is the current/live page in jquery-mobile?

开发者 https://www.devze.com 2023-04-06 01:11 出处:网络
I need to fin开发者_Python百科d out what page is loaded in query mobile for a javascript script. I have been looking at: $.mobile.activePage but can\'t seem to work out how.

I need to fin开发者_Python百科d out what page is loaded in query mobile for a javascript script. I have been looking at: $.mobile.activePage but can't seem to work out how.

It would be good to have: if($.mobile.activePage = "#page"){


$.mobile.activePage returns a jQuery object. SO you should probably try something like this:

if($.mobile.activePage.attr("id") == "page"){


You can get the currently active page by using $.mobile.activePage

If you want to test that a selected jQuery element is the current page you could look for the existence of the "ui-page-active" class:

if ($("#myPage").is(".ui-page-active")) { ... }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号