Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created February 23, 2010 05:08
Embed
What would you like to do?
How to load jQTouch to a different div than the main one
<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>
@mjangda
Copy link
Author

mjangda commented May 6, 2010

Glad to help! And thanks for pointing out the typo -- fixed now!

@Orange06
Copy link

'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