html - jQuery Script Triggering Another jQuery Script -


i making use of 2 jquery scripts in page made of repeating elements (a gallery of thumbnails basically). scripts @ end of html page in 2 separate script tags.

the first calls script making use of touchtouch plugin presents images in nice overlay , allows swipe navigate.

the second infinite ajax scroll appends more items page scroll down.

the problem seem having when page first loads, touchtouch script modifies thumbs present on page. scroll , infinite scroll script appends more thumbs, newly appended thumbs not modified touchtouch script, not function should when clicked on.

how make touchtouch script run again after infinite scroll script has added new elements page?

here snippet end of html

<script src="assets/touchtouch.jquery.js" type="text/javascript"></script>  <script> $(function(){  // initialize gallery $('#thumbs a').touchtouch(); });  </script>   <script type="text/javascript" src="assets/jquery-ias.min.js"></script>  <script type="text/javascript"> var ias = $.ias({      container: "#thumbs",     item: ".thumb",      pagination: "#pagination",      next: ".next a"  });    ias.extension(new iasspinnerextension());    ias.extension(new iastriggerextension({offset: 5}));    ias.extension(new iasnoneleftextension({text: 'there no more pages left load.'}) );  </script>  </body>  </html> 

using infinite ajax scrolling plugin, can have run callback function once has loaded images. in function can call .touchtouch() method again.

ias.on('rendered', function(items) {   $('#thumbs a').touchtouch(); }); 

Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -