The content directly written in html can be rolled, and the html structure dynamically inserted with js cannot be rolled. why? The content directly written in html can be rolled, and the html structure dynamically inserted with js cannot be rolled. why?
Reply content:
The content directly written in html can be rolled, and the html structure dynamically inserted with js cannot be rolled. why?
The iScroll object has a method called refresh (), which can be called after html is inserted.
Hello, I have encountered this problem before. you just need to insert the html structure into the page with js and then instantiate iscroll. I hope this will help you!
Like this example ('{cart-pop'{.html (str); stateMap. myScroll3 = new IScroll ('# wrapper-cart', {mouseWheel: true, click: true, probeType: 2 });
This is because the scroller height is not fixed during iscroll initialization. You can initialize iscroll after loading your dom. For example, write the iscroll initialization method in the success function of ajax.
Let iscroll re-calculate the height.