1 //set up the theme switcher on the homepage
2 $('div').live('pagecreate',function(event){
3 if( !$(this).is('.ui-dialog')){
4 var appendEl = $(this).find('.ui-footer:last');
6 if( !appendEl.length ){
7 appendEl = $(this).find('.ui-content');
10 if( appendEl.is("[data-position]") ){
14 $('<a href="#themeswitcher" data-'+ $.mobile.ns +'rel="dialog" data-'+ $.mobile.ns +'transition="pop">Switch theme</a>')
22 .wrap('<div class="jqm-themeswitcher">')
23 .bind( "vclick", function(){
30 //collapse page navs after use
32 $('body').delegate('.content-secondary .ui-collapsible-content', 'click', function(){
33 $(this).trigger("collapse")
37 function setDefaultTransition(){
38 var winwidth = $( window ).width(),
41 if( winwidth >= 1000 ){
44 else if( winwidth >= 650 ){
48 $.mobile.defaultPageTransition = trans;
53 setDefaultTransition();
54 $( window ).bind( "throttledresize", setDefaultTransition );