Monday, October 20, 2014

jQuery mobile swipping the contents

Be The First To Comment
Snippets on jQuery mobile swipping the contents:

 //HTML  
 <div data-role="content" id="content1"></div>  
 <div data-role="content" id="content2"></div>  
 <div data-role="content" id="content3"></div> 
 
 //JQ script  
 $(document).one('pagebeforecreate',function(){  
 $("div[data-role='content']").bind('swipeleft', function(e){  
           var next=$(this).next("div[data-role='content']");  
           e.stopImmediatePropagation();  
           console.log(next);  
           return false;  
      }); 
 
 $("div[data-role='content']").bind('swiperight', function(e){  
      var perv=$(this).prev("div[data-role='content']");  
           e.stopImmediatePropagation();  
           console.log(perv);  
           return false;  
      });  
 )}  
 

© 2011 GIS and Remote Sensing Tools, Tips and more .. ToS | Privacy Policy | Sitemap

About Me