Integrating jQuery mobile page transitions with my WordPress theme
-
I’m trying to integrate jquery mobile page transitions into my WordPress theme using the advice on this site
In my functions.php file I included:
function theme_js() { wp_register_script( 'jquery.mobile', 'http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js', array('jquery'), '', false); wp_enqueue_script( 'jquery.mobile' ); wp_enqueue_script( 'theme_js', get_template_directory_uri() . '/js/theme.js', array('jquery'), '', false); } add_action( 'wp_enqueue_scripts', 'theme_js' );
My theme.js file:
`jQuery(document).ready(function(){
(‘#wrapper’).live(‘pagecreate’, function(){
jQuery(‘a’).attr(‘data-transition’,’flip’);
});
});
`
In header.php, just after the opening<body>
tag, I created a wrapper div:<div data-role="page" id="wrapper" class="wrapper">
And then closed it in footer.php right before the closing
</body>
tag. I’m obviously doing something wrong because when I test the site the page transitions aren’t working. I’m using WordPress 3.9.1. This is a custom theme that I’m developing and you can see the site hereAny help is greatly appreciated.
- The topic ‘Integrating jQuery mobile page transitions with my WordPress theme’ is closed to new replies.