$(function () { /*媒体米兰app官方网站*/ const iconlist = document.querySelectorAll('.post-13 .news_title'); const regex = /【(.*?)】/; iconlist.forEach(e => { const str = e.innerText; const match = str.match(regex); let imgName = ''; if (!match || !match[1]) return; switch (match[1]) { case '安徽共青团': imgName = 'gqt.png'; break; case '安徽日报': imgName = 'ahrb.png'; break; case '安徽经济网': imgName = '1.png'; break; case '工人日报客户端': imgName = 'grrb.jpg'; break; case '安徽学联': imgName = 'ahxl.png'; break; case '安徽教育网首页': imgName = 'ahjyw.png'; break; case '凤凰网': imgName = 'fhw.png'; break; case '中国青年报客户端': imgName = 'zgqnb.png'; break; case '新华网': imgName = 'xhw.png'; break; case '中国网': imgName = 'zgw.png'; break; case '安青网': imgName = 'aqw.jpg'; break; case '安徽科技报': imgName = 'ahkjb.jpg'; break; case '中国教育在线': imgName = 'zgjyzx.jpg'; break; case '滁州日报': imgName = 'czrbs.png'; break; case '中国青年报': imgName = 'zgqnb.png'; break; case '央视一套': imgName = 'ysyt.jpg'; break; case '滁州广播电视网': imgName = 'czgbdsw.png'; break; case '安徽日报客户端': imgName = 'ahrbkhd.png'; break; case '科技日报': imgName = 'kjrb.png'; break; case '新浪财经': imgName = 'xlcj.png'; break; case '安徽财经网': imgName = 'ahcjw.png'; break; case '搜狐': imgName = 'sh.png'; break; case '安徽省教科文卫体工会': imgName = 'ahsjkwwtgh.png'; break; case '滁州广播电视': imgName = 'czgbdsb.png'; break; case '滁州广播电视报': imgName = 'czgbds.png'; break; case '中安在线': imgName = 'zazx.png'; break; case '安徽网': imgName = 'ahw.png'; break; case '中国女画家协会': imgName = 'zgnhjxh.png'; break; case '安徽视讯': imgName = 'ahsx.png'; break; case '市场星报': imgName = 'scxb.png'; break; case '人民网': imgName = 'rmw.png'; break; case '安徽新闻联播': imgName = 'ahxwlb.png'; break; case '安徽卫视': imgName = 'anws.png'; break; case '安徽教育网': imgName = 'ahjyw.png'; break; case '安徽省教育厅官微': imgName = 'ahsjyt.jpg'; break; case '中国日报网': imgName = 'zgrb.png'; break; case '马鞍山文明网': imgName = 'maswmw.png'; break; case '网易': imgName = 'wangyi.png'; break; case '新浪网': imgName = 'sinawang.png'; break; case '文旅中国': imgName = 'wenlvzg.png'; break; case '思政安徽': imgName = 'szanhui.png'; break; case '中国新闻网': imgName = 'zhongguoxww.png'; break; case '澎湃': imgName = 'pengpai.png'; break; case '中国西藏网': imgName = 'zgxizangw.png'; break; case '安徽青年报': imgName = 'anhuiqingnian.png'; break; case '中国教育新闻网': imgName = 'zgjiaoyuxinwen.png'; break; case '六安新闻网': imgName = 'liuanxinwen.png'; break; case '安徽新闻网': imgName = 'anhuixinwenw.png'; break; case '天长新闻': imgName = 'tianchangxw.png'; break; case '学习强国': imgName = 'xuexiqiangguo.png'; break; case '中视新闻': imgName = 'zhongshixw.png'; break; case '国际在线': imgName = 'guojizaixian.png'; break; case '中华网': imgName = 'zhonghuawang.png'; break; case '川观新闻': imgName = 'cgxwxw.png'; break; case '光明日报': imgName = 'guangmrb.jpg'; break; case '云南网': imgName = 'yunnanwang.png'; break; case '央广网': imgName = 'yangguangwang.png'; break; case '新华社': imgName = 'xhs.png'; break; case '安青网': imgName = 'ygw.png'; break; case '中华人民共和国退役军人事务部': imgName = 'tyjsb.png'; break; case '中华人民共和国国家档案局': imgName = 'zhrmdaj.png'; break; case '滁州女性': imgName = 'meititbchuzhounx.png'; break; case '中国教育新闻网': imgName = 'zgjyxww.png'; break; case '中国社会科学网': imgName = 'zgshkxw.png'; break; case '中青在线': imgName = 'zhongqingzaixian.png'; break; case '新安晚报': imgName = 'xinanwanbao.png'; break; case '央视网': imgName = 'yangshiwang.png'; break; case '光明网': imgName = 'guangmingw.png'; break; case '中工网': imgName = 'zhonggongwang.png'; break; case '党建参阅网': imgName = 'djcyw.png'; break; case '人民政协报': imgName = 'renminzxb.png'; break; } let imgurl=$(e).parent().prev().find('img').attr('data-src') $(e).parent().prev().find('img').attr('src',imgurl+imgName) $(e).text($(e).text().replace(regex,'')) }); $(".aside_nv").addClass("shownav") $(".aside_nv .open").click(function(){ $(".aside_nv").toggleClass("shownav") }) $(".down").click(function(){ $(".main1")[0].scrollIntoView({"behavior":"smooth"}) }) $('.mbanner .news_list li.news.n1').addClass('first') $('.mbanner .news_list').slick({ infinite: true, slidesToShow: 1, autoplay: true, slidesToScroll: 1, dots:true, arrows: false, autoplaySpeed: 6000, }); $('.mbanner .news_list li.first').removeClass('first') $(".mbanner .news .news_video").each(function () { if ($(this).find("video").attr("src") == "") { $(this).hide(); $(this).siblings(".news_imgs").show(); } else { $(this).show(); $(this).siblings(".news_imgs").hide(); } }) $('.post-12-l .news_list').slick({ infinite: true, slidesToShow: 1, autoplay: false, slidesToScroll: 1, dots: true, arrows: false, }); $(".post-31 li.news:eq(0)").addClass('active') $(".post-31 li.news").each(function(){ $(this).hover(function(){ $(this).addClass('active').siblings().removeClass('active') }) }) /* $(".post-31 li.news .news_title .button").click(function(){ $(this).parents(".news").siblings().removeClass("active").find(".news_info").slideUp(500) $(this).parents(".news").toggleClass("active") $(this).parents(".news").find(".news_info").slideToggle(500) }) $(".post-31 li.news:eq(0) .button").click() */ $(".main4 .sudy-tab").sudyTab({ handle: ".tab-menu li", content: ".tab-con .post", trigger: "mouseenter", start: 1, autoPlay: { active: false } }); /*新闻tab切换*/ $(".post-21").sudyTab({ handle:".tit .title", content:".con .boxm,.more_btn .more_text", trigger:"mouseenter", start:1, autoPlay:{ active:false } }); $('.post-32 .douyin .news_list .news').each(function(){ if($(this).find('.source').attr('data-name').indexOf('微信')!=-1){ $(this).addClass('wx') } else if($(this).find('.source').attr('data-name').indexOf('抖音')!=-1){ $(this).addClass('dy') } }) $('.post-51 .news_list').slick({ slide: 'li', //滑动元素查询 dots: false, infinite: true, speed: 500, autoplay: false, autoplaySpeed: 10000, fade: false, slidesToShow: 4, slidesToScroll: 1, useCSS: false, //使用 CSS3 过度 arrows: true, //左右箭头 responsive: [ { breakpoint: 999, settings: { slidesToShow: 3, } }, { breakpoint: 767, settings: { slidesToShow: 2, } }, { breakpoint: 479, settings: { slidesToShow: 1, } } ] }); /*新闻tab切换*/ $(".tabbox").sudyTabs({ handle:".tit .title", content:".boxm,.more_btn .more_text", trigger:"mouseenter", start:1, autoPlay:{ active:false } }); }); var url="zjh"; $("a").each(function(){ if($(this).attr("href") && !$(this).attr("href").includes(url)){ $(this).attr("target","_blank") } })