Skip to content

JQuery Mobile Tips #1

August 13, 2011

A really nice feature that I have found is using the ‘live’ event for dialog close, after thinking it had been pageclose or dialogclise, looking in the official JQuery documentation, the actual keyword was ‘pagehide’.
This is the code to trigger an event in closing the dialog box using its element ID as the identifier:-

$(“#dialog”).live(‘pagehide’, function(event, ui) { $(this).hide(); });

This event actually hides the dialog box from use, and when checking Mozilla Firefox, its not available to use in the DOM, otherwise if you don’t call this event, multiple DOMs of the dialog box are available in the DOM tree as I observed. Hope that helps!

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: