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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
$(function(){
changeBannerInit();
function changeBannerInit(){
var changeBannerFn = function(){
var Config = {
}
var FunInit = function(){
var now = new Date().getTime(),
timeStart = Date.parse(Config.timeStart),
timeEnd = Date.parse(Config.timeEnd),
data = Config.data;
if (now >= timeStart && now < timeEnd) {
$('[data-changeimg]').each(function(i,e){
$(this).attr('src',data[$(this).data('changeimg')]);
$(this).bind('click',function(event){
window.open('https://www.acadsoc.com.cn/lps/act2018/nov3.htm');
})
})
$('[data-changebg]').each(function(i,e){
$(this).css({
'background-image':'url('+data[$(this).data('changebg')]+')',
'height':500
});
$(this).bind('click',function(event){
window.open('https://www.acadsoc.com.cn/lps/act2018/nov3.htm');
});
})
$('[data-change=hide]').hide();
$('[data-change=visiblehide]').css('visibility','hidden');
}
}
return {
init: function(option){
Config = $.extend(true, Config, option);
FunInit();
}
}
}();
var changeData = {
'banner':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018.jpg',
'banner-logo':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-logo.jpg',
'banner-reg':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-reg.jpg',
'banner-reg-logo':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-reg-logo.jpg',
'banner-m':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-m.jpg',
'banner-m-logo':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-m-logo.jpg',
'banner-m-zh1':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-m-zh1.png',
'banner-m-hl':'https://img.acadsoc.com.cn/web/lps/activity/img/banners/DoubleEleven2018-m-hl.png'
}
changeBannerFn.init({
timeStart: 'November 9, 2018 11:00:00',
timeEnd: 'November 12, 2018 00:00:00',
data: changeData
})
}
})