Skip to content Skip to sidebar Skip to footer

Iscroll 4 Stops Working Because Of Container Css Created By Javascript Jquery

I'm running iScroll 4 inside a DIV, but the DIV's height is generated dynamically, and screws up iScroll

Solution 1:

have you tried the refresh() method for iScroll?

You do need to change you code a bit because you use the myScroll for multiple elements. So for example if you have 1 element that needs to be iScrolled:

<scripttype="text/javscript">var myScroll;
  functionloaded() {
    myScroll = newiScroll('sidebar-wrapper');
  }
  document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
  document.addEventListener('DOMContentLoaded', loaded, false);

  $(function() {
    $("#latest-tweet").tweet({
      count: 1,
      username: ["motocomdigital"],
      loading_text: "searching twitter..."
    }).bind("loaded", function(){
      // as described on the "Methods" section on http://cubiq.org/iscrollsetTimeout(function () { myScroll.refresh() }, 0);
    });
  });
</script>

Post a Comment for "Iscroll 4 Stops Working Because Of Container Css Created By Javascript Jquery"