iphone - iScroll on div with dynamically added images -


i'm using phonegap create iphone application. i'm trying use iscroll zoom functionality. i'm having problem cannot scroll until zoom in on div. once un-zoom div it's automatically scrolled top.

i've looked @ following 2 threads thought neither solution worked situation.

thread 1

thread

i have div has images added after ajax call. created div wrapper around should zoomable. code followed

<div id = 'zoom-wrapper'>     <div id="historyresponse"></div> </div> 

i have js function called showhistory() has ajax call. on success images added historyresponse div using .append().

after reading 2 threads mentioned above tried added things myscroll.refresh() or destroying recreating myscroll @ end of js function showhistory() nothing fixed problem.

are there other things can try fix problem?

thanks in advance!

try pass option checkdomchanges:true. helped me once sort out similar problem when myscroll.refresh() failed.

something this

if('undefined' !== typeof myscroll){    myscroll.destroy(); }  myscroll = new iscroll('<your_element_id>', { checkdomchanges:true }); 

if still face problem try this

if('undefined' !== typeof myscroll){    myscroll.destroy(); }  myscroll = new iscroll('<your_element_id>', {     checkdomchanges:true,     onbeforescrollstart : function(e){        myscroll.refresh();     }  }); 

i hope @ least 1 solution you. :)


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -