vivek tiwari
vivek tiwari

Reputation: 645

Get active Div id in jquery mobile

I want to customise back key on my android device using jQuery mobile app.

For this firstly I get a active page id and work according to them.

Like this

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

but now I use multiple div and app will show and hide div at run time.

Is there any way in jQuery that will find active div id at runtime? Or is there any other way?

$.mobile.activeDiv.attr("id")..

Something like this. ?

Upvotes: 0

Views: 864

Answers (1)

Gajotres
Gajotres

Reputation: 57309

Working example: http://jsfiddle.net/Gajotres/MN2N6/

alert($.mobile.activePage.find('.content_div:visible').attr('id'));

Upvotes: 1

Related Questions