basedisplay.js
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'], function($, undefined, Frontend,
Form, Template, Swiper, Layer) {
var Controller = {
index: function() {
var first_swiper = new Swiper ('#first_swiper', {
loop: true, // 循环模式选项
// 如果需要分页器
autoplay:true,
pagination: {
el: '.swiper-pagination',
}
});
var lis = $(".main_left li:not(:first-child)");
var category_id = $(".category_id").val();
$.each(lis,function(i,v) {
if($(this).children('a').attr('data-id') == category_id) {
$(this).addClass('left_active');
}
});
},
detail:function(){
var lis = $(".main_left li:not(:first-child)");
var category_id = $(".category_id").val();
$.each(lis,function(i,v) {
if($(this).children('a').attr('data-id') == category_id) {
$(this).addClass('left_active');
}
});
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;
});