269 lines
14 KiB
JavaScript
269 lines
14 KiB
JavaScript
$(function(){
|
||
$('.logo').on('click',function(){//logo图标点击事件
|
||
location.href = 'index.html'
|
||
})
|
||
// 一级导航
|
||
$('.dao-box li div').mouseover(function(){//导航悬浮事件
|
||
$(this).css("cursor","pointer")
|
||
})
|
||
$('.dao-box li div').click(function(){//导航点击事件
|
||
$('.dao-box li div').removeClass('cq-dao-active')
|
||
$('.dao-box li div div').addClass("dn");
|
||
$('.dao-box li span').addClass("dn");
|
||
$(this).find(".xiahx").removeClass('dn')
|
||
$(this).next(".redD").removeClass('dn')
|
||
$(this).addClass('cq-dao-active')
|
||
})
|
||
// 二级导航
|
||
$('.zx-nav li a').click(function(){
|
||
$('.zx-nav li a').removeClass('zx-nav-title')
|
||
$('.zx-nav li div').removeClass('zx-nav-active')
|
||
$(this).addClass('zx-nav-title')
|
||
$(this).next("div").addClass('zx-nav-active')
|
||
})
|
||
//三级导航
|
||
$('.szx-nav li a').click(function(){
|
||
$('.szx-nav li a').removeClass('zx-nav-title')
|
||
$('.szx-nav li div').removeClass('zx-nav-active')
|
||
$(this).addClass('zx-nav-title')
|
||
$(this).next("div").addClass('zx-nav-active')
|
||
})
|
||
// 资讯页面
|
||
// 信息动态、新闻公告切换
|
||
$('#zx-xg').click(function(){
|
||
if(!$(this).find('.xx-one').hasClass('zx-xx')){
|
||
$(this).find('.xx-one').addClass('zx-xx');
|
||
$(this).find('.xx-one').removeClass('zx-gg');
|
||
$(this).find('.gg-one').addClass('zx-gg');
|
||
$(this).find('.gg-one').removeClass('zx-xx');
|
||
} else {
|
||
$(this).find('.gg-one').removeClass('zx-gg');
|
||
$(this).find('.gg-one').addClass('zx-xx');
|
||
$(this).find('.xx-one').removeClass('zx-xx');
|
||
$(this).find('.xx-one').addClass('zx-gg');
|
||
}
|
||
})
|
||
// 机构详情的立即关注
|
||
$('#follow').click(function(){
|
||
if($(this).text()=='立即关注'){
|
||
$(this).text('已关注')
|
||
$(this).removeClass('borr')
|
||
$(this).addClass('borf')
|
||
} else {
|
||
$(this).text('立即关注')
|
||
$(this).removeClass('borf')
|
||
$(this).addClass('borr')
|
||
}
|
||
})
|
||
|
||
// let childer = document.querySelectorAll('.ysj .ya-item-box').length
|
||
// if(childer==5) {
|
||
// $('.ysj').css({"justify-content":"space-between","marginRight":0})
|
||
// $('.ysj .ya-item-box').css({"marginRight":0})
|
||
// }
|
||
xxDong()//首页信息动态
|
||
zxList()//资讯列表事件
|
||
checkJG()//机构列表事件
|
||
checkPeo()//机构成员事件
|
||
checkExhibitone()//机构展会事件
|
||
checkArt()//机构艺术品事件
|
||
$(window).scroll(function() {
|
||
if (($(window).height() + $(window).scrollTop() + 0) >= $(document).height()) {
|
||
zxList()
|
||
checkJG()
|
||
checkPeo()
|
||
checkExhibitone()
|
||
checkArt()
|
||
}
|
||
});
|
||
|
||
|
||
// 监听页面滚动条变化
|
||
$(window).scroll(function(){
|
||
// 获取滚动条距离顶部的距离
|
||
let s = $(window).scrollTop();
|
||
if(s > 1000){
|
||
$('#gotoTop').fadeIn(100);
|
||
} else {
|
||
$('#gotoTop').fadeOut(200);
|
||
}
|
||
})
|
||
})
|
||
function xxDong(){//首页信息动态
|
||
var html = '';
|
||
var data = [
|
||
{imgSrc:'img/public/xin-one.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
|
||
{imgSrc:'img/public/xin-two.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
|
||
{imgSrc:'img/public/xin-three.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
|
||
{imgSrc:'img/public/xin-four.png',title:'助力熊猫艺术公益:中国邮政发布著名画家刘中《牛气冲...',time:'2021.06.30',content:'爱彼秉承品牌在形式与功能方面的大无畏创新精神,在腕表发展史上扮演着先行者的角色爱彼秉承品牌在形式与功能方面的大无畏创新精神,在碗表发展史上扮演...'},
|
||
]
|
||
$.each(data, function(commentIndex, comment) {
|
||
html +=`<div class="dac backf p-sx20 w48 m-x32">
|
||
<img src="${comment.imgSrc}" class="xx-img" alt="图片丢失" title="${comment.title}">
|
||
<div class="m-zy15">
|
||
<div class="clips1 font-18 col19">${comment.title}</div>
|
||
<div class="font-12 col9 m-sx10">${comment.time}</div>
|
||
<div class="clips2 font-12 xx-content">${comment.content}</div>
|
||
</div>
|
||
</div>`
|
||
});
|
||
$('.msg').prepend(html);
|
||
}
|
||
function zxList(){//资讯页全部下的列表
|
||
var zxHtml = '';
|
||
var zxData = [
|
||
{imgSrc:'../../img/public/zx-01.png',title:'【华夏艺术网·展讯】花事匆匆,美人依旧丨苏茂隆个展成都永陵博物馆即将呈现',time:'2021.06.30',content:'人称“苏美人”的画家苏茂隆,近两年几乎没有公开的规模展览。这批新作乃近两年仕女画的探索性力作。一部分作品沿袭过往仕女画经典技法,而由于近两年苏茂隆的住家环境的变化,自身也在做颇为冒险的技法探索。地创作了一批彩墨作品。'},
|
||
{imgSrc:'../../img/public/zx-02.png',title:'【华夏艺术网·展讯】花事匆匆,美人依旧丨苏茂隆个展成都永陵博物馆即将呈现',time:'2021.06.30',content:'人称“苏美人”的画家苏茂隆,近两年几乎没有公开的规模展览。这批新作乃近两年仕女画的探索性力作。一部分作品沿袭过往仕女画经典技法,而由于近两年苏茂隆的住家环境的变化,自身也在做颇为冒险的技法探索。地创作了一批彩墨作品。'},
|
||
{imgSrc:'../../img/public/zx-03.png',title:'【华夏艺术网·展讯】花事匆匆,美人依旧丨苏茂隆个展成都永陵博物馆即将呈现',time:'2021.06.30',content:'人称“苏美人”的画家苏茂隆,近两年几乎没有公开的规模展览。这批新作乃近两年仕女画的探索性力作。一部分作品沿袭过往仕女画经典技法,而由于近两年苏茂隆的住家环境的变化,自身也在做颇为冒险的技法探索。地创作了一批彩墨作品。'},
|
||
{imgSrc:'../../img/public/zx-04.png',title:'【华夏艺术网·展讯】花事匆匆,美人依旧丨苏茂隆个展成都永陵博物馆即将呈现',time:'2021.06.30',content:'人称“苏美人”的画家苏茂隆,近两年几乎没有公开的规模展览。这批新作乃近两年仕女画的探索性力作。一部分作品沿袭过往仕女画经典技法,而由于近两年苏茂隆的住家环境的变化,自身也在做颇为冒险的技法探索。地创作了一批彩墨作品。'},
|
||
]
|
||
$.each(zxData, function(commentIndex, comment) {
|
||
zxHtml +=`<div class="bbt djbac psx p-sx30" onclick="goZXDetail(${commentIndex})">
|
||
<div class="fs m-y30">
|
||
<img style="width: 100%;" src="${comment.imgSrc}" alt="图片丢失" title="${comment.title}">
|
||
</div>
|
||
<div>
|
||
<div class="font-13 col7d m-x10">${comment.time}</div>
|
||
<div class="font-20 zx-title">${comment.title}</div>
|
||
<div class="m-s30 col7d m-x10 zx-dian">◆ ◆ ◆ ◆</div>
|
||
<div class="font-15 col19 linh28" style="text-indent: 2em;">${comment.content}</div>
|
||
</div>
|
||
</div>`
|
||
});
|
||
$('#zx-list').prepend(zxHtml);
|
||
$('#zx-list div').mouseover(function(){//导航悬浮事件
|
||
$(this).css("cursor","pointer")
|
||
$(this).find(".zx-title").css('color','#CB1919')
|
||
$(this).find(".zx-dian").css('color','#CB1919')
|
||
})
|
||
$('#zx-list div').mouseout(function(){//导航悬浮事件
|
||
$(this).find(".zx-title").css('color','#000000')
|
||
$(this).find(".zx-dian").css('color','#7d7d7d')
|
||
})
|
||
}
|
||
function goZXDetail(e){//查看资讯详情
|
||
location.href = `realTimeInfoDetail.html?id=${e}`
|
||
}
|
||
function checkJG(){//查询机构列表
|
||
let jgHtml = '';
|
||
let jgData = [
|
||
{imgSrc:'../../img/public/jg-01.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-02.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-03.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-04.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-05.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-06.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-07.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-08.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-09.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-10.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-11.png',title:'摩空精舍'},
|
||
{imgSrc:'../../img/public/jg-12.png',title:'摩空精舍'},
|
||
]
|
||
$.each(jgData, function(commentIndex, comment) {
|
||
jgHtml +=`<div class="dfc w33 m-s30" onclick="goJGDetail(${commentIndex})">
|
||
<img class="w96" src="${comment.imgSrc}" alt="图标丢失" title="${comment.title}" >
|
||
<div class="font-18 fb m-s20 w96 clips1">—<span class="m-z10">${comment.title}</span></div>
|
||
</div>`
|
||
});
|
||
$('#jg-list').prepend(jgHtml);
|
||
$('#jg-list img').mouseover(function(){//导航悬浮事件
|
||
$(this).css({"cursor":"pointer"})
|
||
$(this).next('div').css('color','#CB1919')
|
||
})
|
||
$('#jg-list img').mouseout(function(){//导航悬浮事件
|
||
$(this).next('div').css('color','#000000')
|
||
})
|
||
}
|
||
function goJGDetail(e){//查看机构详情
|
||
location.href = `mechanismDetail.html?id=${e}`
|
||
}
|
||
function checkPeo(){//查询机构成员列表
|
||
let jgmHtml = '';
|
||
let jgmData = [
|
||
{imgSrc:'../../img/public/jg-dp-01.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-02.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-03.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-04.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-05.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-06.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-07.png',title:'张龙森'},
|
||
{imgSrc:'../../img/public/jg-dp-09.png',title:'张龙森'},
|
||
]
|
||
$.each(jgmData, function(commentIndex, comment) {
|
||
jgmHtml +=`<div class="dfc w25 m-s30">
|
||
<img class="w90" src="${comment.imgSrc}" alt="图标丢失" title="${comment.title}" >
|
||
<div class="font-18 fb m-s20 w90 clips1" style="text-align: center;">${comment.title}</div>
|
||
</div>`
|
||
});
|
||
$('#jgm-list').prepend(jgmHtml);
|
||
$('#jgm-list img').mouseover(function(){//导航悬浮事件
|
||
$(this).css({"cursor":"pointer"})
|
||
$(this).next('div').css('color','#CB1919')
|
||
})
|
||
$('#jgm-list img').mouseout(function(){//导航悬浮事件
|
||
$(this).next('div').css('color','#000000')
|
||
})
|
||
}
|
||
function checkExhibitone(){//查询机构展会列表
|
||
let jgzHtml = '';
|
||
let jgzData = [
|
||
{imgSrc:'../../img/public/jg-dz-01.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-02.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-03.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-04.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-05.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-06.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-07.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dz-08.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
]
|
||
$.each(jgzData, function(commentIndex, comment) {
|
||
jgzHtml +=`<div class="dfc w25 m-s30">
|
||
<img class="w90" src="${comment.imgSrc}" alt="图标丢失" title="${comment.title}" >
|
||
<div class="font-18 fb m-s20 w90 clips1">${comment.title}</div>
|
||
<div class="font-13 m-s10 w90 clips1">展览时间:${comment.time}</div>
|
||
</div>`
|
||
});
|
||
$('#jgz-list').prepend(jgzHtml);
|
||
$('#jgz-list img').mouseover(function(){//导航悬浮事件
|
||
$(this).css({"cursor":"pointer"})
|
||
$(this).next('div').css('color','#CB1919')
|
||
})
|
||
$('#jgz-list img').mouseout(function(){//导航悬浮事件
|
||
$(this).next('div').css('color','#000000')
|
||
})
|
||
}
|
||
function checkArt(){//机构艺术品事件
|
||
let jgyHtml = '';
|
||
let jgyData = [
|
||
{imgSrc:'../../img/public/jg-dy-01.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-02.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-03.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-04.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-05.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-06.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-07.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
{imgSrc:'../../img/public/jg-dy-08.png',title:'陌上谁人依旧 · 曹辉人物画展',time:'2021.07.09 - 2021.07.19'},
|
||
]
|
||
$.each(jgyData, function(commentIndex, comment) {
|
||
jgyHtml +=`<div class="dfc w25 m-s30">
|
||
<img class="w90" src="${comment.imgSrc}" alt="图标丢失" title="${comment.title}" >
|
||
<div class="font-18 fb m-s20 w90 clips1" style="text-align: center;">${comment.title}</div>
|
||
</div>`
|
||
});
|
||
$('#jgy-list').prepend(jgyHtml);
|
||
$('#jgy-list img').mouseover(function(){//导航悬浮事件
|
||
$(this).css({"cursor":"pointer"})
|
||
$(this).next('div').css('color','#CB1919')
|
||
})
|
||
$('#jgy-list img').mouseout(function(){//导航悬浮事件
|
||
$(this).next('div').css('color','#000000')
|
||
})
|
||
}
|
||
// 回到顶部
|
||
function pageScroll(){
|
||
window.scrollBy(0,-100);
|
||
scrolldelay = setTimeout('pageScroll()',0);
|
||
var sTop = document.documentElement.scrollTop+document.body.scrollTop;
|
||
if(sTop==0) clearTimeout(scrolldelay);
|
||
} |