staticIndex.js 780 Bytes
layui.use('carousel', function () {
    var carousel = layui.carousel;
    //建造实例
    carousel.render({
        elem: '#banner_swiper'
        , width: '100%' //设置容器宽度
        , arrow: 'always' //始终显示箭头
        , autoplay: true
        , height: '500px'
    });
});
//注意:导航 依赖 element 模块,否则无法进行功能性操作
layui.use('element', function () {
    var element = layui.element;

    //…
});
layui.use('util', function () {
    var util = layui.util;
    //执行
    util.fixbar({
        bar1: true,
        bar2: true,
        top: true
        , click: function (type) {
            console.log(type);
            if (type === 'bar1') {
                alert('点击了bar1')
            }
        }
    });
});