Created
February 23, 2010 05:08
-
-
Save mjangda/311881 to your computer and use it in GitHub Desktop.
How to load jQTouch to a different div than the main one
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Save the hash the user loaded the page with | |
var page = (location.hash) ? location.hash : ''; | |
// When you instantiate the jQTouch object, it will revert the hash to the top div on the page or the div with class="current" | |
$jQT = new $.jQTouch({ | |
icon: 'jqtouch.png', | |
statusBar: 'black-translucent', | |
preloadImages: [ | |
'themes/jqt/img/chevron_white.png', | |
'themes/jqt/img/bg_row_select.gif', | |
'themes/jqt/img/back_button_clicked.png', | |
'themes/jqt/img/button_clicked.png' | |
] | |
}); | |
$(document).ready(function() { | |
// If we have page set, make jQTouch go to that page | |
if (page) jQT.goTo(page, 'slide'); | |
}); | |
</script> |
Glad to help! And thanks for pointing out the typo -- fixed now!
'slide' will also make you issues, now, 4 years late, you have to write either slideup, slidedown, slideleft, slideright, flip... for more info about these options, you can ad before the end of above script console.log(jQT) to see full list of animations, settings and other useful stuff.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
just what i needed, thanks! one note that JQt.goto should be JQT.goTo. thanks!