elegant.js 1.0 KB
define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'], function($, undefined, Frontend,
                                                                                            Form, Template, Swiper, Layer) {
    var Controller = {
        index: function() {
            // console.log(true)
            var first_swiper = new Swiper ('#first_swiper', {
                loop: true, // 循环模式选项
                // 如果需要分页器
                autoplay:true,
                pagination: {
                    el: '.swiper-pagination',
                }
            })
        },
        detail:function(){

            console.log($(document).find(".detial_content img"));
            $(document).find(".detial_content img").each(function(i,e){
                var src = $(e).attr("src");
                if(src.search("https://energy.xmu.edu.cn") == -1){
                    $(e).attr("src","https://energy.xmu.edu.cn"+src);
                }
            });
        }
    }
    return Controller;
});