When there are multiple classes of the same class: What should I do when iscroll instantiates an unknown number of content blocks? What should I do if I only write one instance and only the first content will take effect? Do I need to write a for loop? how to write?
仅有的幸福2017-05-16 13:40:23
<script>
var iscroll = document.getElementsByClassName("my-iscroll-wrapper");
for (var i = 0; i < iscroll.length; i++) {
var myScroll = new IScroll(iscroll[i], {
//代码块
});
}
</script>