<div class="mui-collapse-content">
<div class="mui-slider" id="slider">
<div class="mui-slider-group mui-slider-loop">
<div class="mui-slider-item mui-slider-item-duplicate">
<a href="#"><img src="img/44.jpg"/></a>
</div>
<!--第一个内容区容器-->
<div class="mui-slider-item mui-active">
<a href="#"> <img src="img/22.jpg"/> </a>
</div>
<!--第二个内容区-->
<div class="mui-slider-item">
<a href="#"> <img src="img/33.jpg"/></a>
</div>
<!--第三个内容区-->
<div class="mui-slider-item">
<a href="#"><img src="img/44.jpg"/></a>
</div>
<div class="mui-slider-item mui-slider-item-duplicate">
<a href="#"> <img src="img/22.jpg"/> </a>
</div>
</div>
<!--指示器-->
<div class="mui-slider-indicator">
<div class="mui-indicator mui-active"></div>
<div class="mui-indicator"></div>
<div class="mui-indicator"></div>
</div>
</div>
</div>
js:
<script type="text/javascript">
mui.init();
mui(".mui-slider").slider({interval:2000});
</script>
浏览器报错:
[Web浏览器] "Uncaught TypeError: Cannot read property '0' of undefined" /test/js/mui.js (4994)
2 个回复
TOMOK
你JS文件路径错误,加qq群:101263124,讨论
u***@163.com - 前端
最外层加个定时器就可以啦,亲测有效!
setTimeout(function() {
mui(".mui-slider").slider({
interval: 2000
});
}, 500);