• mui动态生成轮播图


    <div class="lunbo">
          <!--<img class="lunbo-img" src="img/shouye1.png" />-->
          <div class="mui-slider">
               <div class="mui-slider-group mui-slider-loop">
                                
               </div>
               <div class="mui-slider-indicator">
                                
               </div>
           </div>
    </div>
    function hotList() {
                $.ajax({
                    type: "post",
                    url: IP + "/mobile/ad/hotList.html",
                    dataType: "json",
                    success: function(data) {
                        console.log(JSON.stringify(data));
                        $('.mui-slider-group').empty();
                        $('.mui-slider-indicator').empty();
                        var length = data.data.list.length;
                        if(length == 1) {
                            console.log(data.data.list[0].src)
                            $('.mui-slider-group').append('<div class="mui-slider-item"><img class="lunbo-img" src="' + data.data.list[0].src + '" /></div>');
                        } else {
                            $('.mui-slider-group').append('<div class="mui-slider-item mui-slider-item-duplicate"><img class="lunbo-img" src="' + data.data.list[length - 1].src + '" /></div>');
                            $('.mui-slider-indicator').append('<div class="mui-indicator mui-active"></div>');
                            for(var i = 0; i < length; i++) {
                                $('.mui-slider-group').append('<div class="mui-slider-item"><img class="lunbo-img" src="' + data.data.list[i].src + '" /></div>');
                            }
                            $('.mui-slider-group').append('<div class="mui-slider-item mui-slider-item-duplicate"><img class="lunbo-img" src="' + data.data.list[0].src + '" /></div>');
                            for(var i = 0; i < length - 1; i++) {
                                $('.mui-slider-indicator').append('<div class="mui-indicator"></div>');
                            }
                        }
                        var gallery = mui('.mui-slider');
                        gallery.slider({
                            interval: 5000 //自动轮播周期,若为0则不自动播放,默认为0;
                        });
                    }
                });
            }
  • 相关阅读:
    Python图形图像处理库的介绍之Image模块
    python re.sub
    eclipse 安装git插件
    一组神奇的 3D Gif 动图
    互联网颠覆房地产
    一位IT行业高收入者的理财规划方案
    阿里核心系统团队介绍
    大规模SNS中兴趣圈子的自动挖掘
    关于 MySQL LEFT JOIN 你可能需要了解的三点
    Could not connect to SMTP host: localhost, port: 25;
  • 原文地址:https://www.cnblogs.com/ccllj/p/9643129.html
Copyright © 2020-2023  润新知