So I used the jquery mobile ui to do a page, swipe left/right, now this dosen't work for me since I just want to swipe only the content, not the entery body of the page, I tried to use data-role="content"
but It doesn't work anymore only with data-role="page"
is it posibile to have that swipe animation, but only for the content?
I have some <article>
and I want to swipe them left/right....but I don't want to swipe the header and other things..just the middle section.
And also to disable that stupid jquery mobile theme if posibile.
//Le
Code structure
<header data-role="header"> .... </header>
<section>
<!-- only this part I want to swipe, one article at a time -->
<article data-role="page"> ..... </article>
<article data-role="page"> ..... </article>
<article data-role="page"> ..... </article>
<article data-role="page"> ..... </article>
<!-- only this part I want to swipe, one article at a time -->
</section>
<footer> ... </footer>
$('article').bind("swipeleft", function(){
var nextpage = $(this).next('article[data-role="page"]');
// swipe using id of next page if exists
if (nextpage.length > 0) {
$.mobile.changePage(nextpage, {transition: "slide",
reverse: false}, true, true);
}
});
$('article').bind("swiperight", function(){
var prevpage = $(this).prev('article[data-role="page"]');
if (prevpage.length > 0) {
$.mobile.changePage(prevpage, {transition: "slide",
reverse: true}, true, true);
}
});