Swipe Content

Swipe Content

Hello the community ! 

In a first time i hope my question doesn't exist already, i don't found it.
And all my apologize if i doing some mistake... I'm french and not perfect in english..

I developing a Mobile version of a website and i want put in place a Swipe event for the content.

I don't what swipe all the page but only the content. I show you my page example.

  1. <body>

  2. <!-- **********************PAGE ONE************************ -->

  3. <div id="page1" data-role="page" data-theme="a" >
  4.        <div data-role="header" data-theme="b">
  5.                         Page 1
  6.        </div>
  7.        <div data-role="content">
  8. A content from page 1
  9.                         </div>
  10.        <div  data-role="footer" data-position="fixed" data-tap-toggle="false">
  11.         <a href="#page-one" data-icon="home" data-inline="true">Contact</a>
  12.        </div> 
  13.    </div>

  14. <!-- **********************PAGE TWO************************ -->

  15. <div id="page2" data-role="page" data-theme="a" >
  16.         <div data-role="header" data-theme="b">
  17.                         Page 2
  18.         </div>
  19.         <div data-role="content" prev-index="3" next-index="2">
  20. A content from page 2
  21.                         </div>
  22.                         <div id="content1" data-role="content" prev-index="1" next-index="3">
  23. A content from page 2
  24.                         </div>
  25.                         <div id="content2" data-role="content" prev-index="2" next-index="1">
  26. A content from page 2
  27.                         </div>
  28.         <div id="content3" data-role="footer" data-position="fixed" data-tap-toggle="false">
  29.          Footer
  30.         </div> 
  31.     </div>
  32.  

Is it possible ? At the start the content with ID= content2 and Content 3 is hide.
I want that the swipe change only the content and keep the header/Footer immobile.

Before i use a script like that, but this one change all the pages...

  1. $(document).ready(function() {
  2.             $("[data-role='page']").live('swiperight swipeleft', function(event) {
  3.                 var swipeindex = '';
  4.                 var reverseValue = false;
  5.                 if (event.type == "swiperight") {
  6.                     swipeindex = "#page" + $.mobile.activePage.data("prev-index");
  7.                     reverseValue = true;
  8.                 } else if (event.type == "swipeleft") {
  9.                     swipeindex = "#page" + $.mobile.activePage.data("next-index");
  10.                 }
  11.                 
  12.                 if (swipeindex != '#page') {
  13.                     $.mobile.changePage(swipeindex, { type : "get", transition : "slide", reverse : reverseValue });
  14.                 }
  15.                 event.preventDefault();
  16.             });
  17.         });

Thanks for help