i need implement iscroll in jquery mobile pages. need scroll large table horizontally. since first beta of iscroll 5 has been released, i'd use version, include horizontal scrolling mode.
here's global syntax of code i'm supposed use :
<html> <head> <meta name="apple-mobile-web-app-capable" content="yes"> <script src="/javascript/jquery-1.9.1.min.js"></script> <script src="/javascript/jquery.mobile-1.3.0.min.js"></script> <script src="/javascript/iscroll.js"></script> <script type="text/javascript"> var myscroll; function loaded () { myscroll = new iscroll('#wrapper', { eventpassthrough: true, scrollx: true, scrolly: false }); } </script> <head> <body onload="loaded()"> <div data-role="page"> <div data-role="content" id="content"> <div id="wrapper"> <div id="scroller"> <table> </table> </div> </div> </div> </div> </body> </html> the problem jquery mobile uses ajax load content. , because page table isn't first page, javascript isn't executed. whole site supposed iphone webapp, can't skip ajax navigation page, otherwise iphone loads page out of webapp, in safari. script works in safari, nothing moves in webapp!
i need explanation on how load these few lines in page, please :
<script type="text/javascript"> var myscroll; function loaded () { myscroll = new iscroll('#wrapper', { eventpassthrough: true, scrollx: true, scrolly: false }); } </script> i've searched lot, found binding script pagecreate event, couldn't make work.
there's special adaptation of iscroll jquery mobile, made iscroll 4... hope!
english isn't first language, please ask me if didn't understand something.
thanks in advance help!
try like:
$(document).on('pageshow', '.mypage', function() { var mypagescroll = new iscroll('#wrapper', { eventpassthrough: true, scrollx: true, scrolly: false }); }); add 'mypage' class page
Comments
Post a Comment