Skip to content

Instantly share code, notes, and snippets.

@mlynch
Created June 18, 2012 21:51
Show Gist options
  • Save mlynch/2950944 to your computer and use it in GitHub Desktop.
Save mlynch/2950944 to your computer and use it in GitHub Desktop.
Page Show
$(":jqmData(role='page')").live('pageshow', function(e) {
// Grab the id of the page that's showing, and select it on the Tab Bar on the page
var tabBar, id = $(e.target).attr('id');
tabBar = $.mobile.activePage.find(':jqmData(role="tabbar")');
if(tabBar.length) {
tabBar.tabbar('setActive', id);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment