Directly written in the HTML content can scroll, with JS dynamically inserted HTML structure can not scroll, what is going on?
Reply content:
Directly written in the HTML content can scroll, with JS dynamically inserted HTML structure can not scroll, what is going on?
The Iscroll object has a method called Refresh (), which is called after inserting the HTML.
Hello landlord, I have encountered this problem before, you only need to first HTML structure with JS Insert page and then instantiate Iscroll on it, hope can help you!
like this $('#cart-pop').html(str); stateMap.myScroll3 = new IScroll('#wrapper-cart', { mouseWheel: true, click: true,probeType: 2});
This occurs because the scroller height is not fixed when initializing Iscroll. You can initialize the Iscroll after you have loaded your DOM. For example, the Iscroll initialization method is written in the Ajax success function.
Just let Iscroll calculate the height again.