Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created February 23, 2010 05:08
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mjangda/311881 to your computer and use it in GitHub Desktop.
Save mjangda/311881 to your computer and use it in GitHub Desktop.
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>
@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