js代码
<script src="js/unslider.min.js"></script> <script> $(document).ready(function(e) { var progress = $(".progress"),li_width = $("#b04 li").length; var unslider04 = $('#b04').unslider({ dots: true, complete:function(index){//自己添加的,官方没有 progress.animate({"width":(100/li_width)*(index+1)+"%"}); } }), data04 = unslider04.data('unslider'); $('.unslider-arrow04').click(function() { var fn = this.className.split(' ')[1]; data04[fn](); }); }); </script>