$(function () { // 领导团队 $(".odf li").hover(function () { var index = $(this).index(); $(this).addclass("active").siblings().removeclass("active"); $(".reo .reokk").eq(index).show().siblings().hide(); }) // -------------------------------- 网站群----------------------------------------------------------------------// $(".wzq-lanmu span").click(function (e) { if ($(this).parents(".wzq-title").next(".wzq-sub")[0].style.display == "none" || $(this).parents(".wzq-title").next(".wzq-sub")[0].style.display == "") { $(this).parents("li").siblings("li").find(".wzq-title").removeclass("active") $(this).parents("li").siblings("li").find(".wzq-sub").slideup(300) $(this).parents(".wzq-title").addclass("active") $(this).parents(".wzq-title").next(".wzq-sub").slidedown(300) } else { $(this).parents(".wzq-title").removeclass("active") $(this).parents(".wzq-title").next(".wzq-sub").slideup(300) } }) // ---------------------------------- 首页-------------------------------------------------------------// if ($("body.sy").length == 1) { // 删除阻止移动端滑动的样式 if ($(window).width() <= 768) { $(".swiper-no-swiping").removeclass("swiper-no-swiping"); // $(".xwzx-rt .swiper-wrapper .swiper-slide:last-child").remove(); // $(".content4-lf .swiper-wrapper .swiper-slide:last-child").remove() } // 删除企业新闻 // if ($(window).width() <= 768) { // $(".xwzx-nav .xwzx-title li:first-child").remove() // $(".xwzx-nav .xwzx-m li:first-child").remove() // } // banner $('.fold_wrap li').mouseover(function(){ $(this).children().children('.pic_auto').addclass('on').parent().parent().siblings("li").children().children('.pic_auto').removeclass('on') }).mouseout(function(){ $('.fold_wrap li').children().children('.pic_auto').removeclass('on'); }) if($(".banner .swiper-slide").length=1){ $(".banner .swiper-button-next,.swiper-button-prev").addclass("rmdk"); var bannerswiper = new swiper('.banner .swiper-container', { slidesperview: 1, loop:false, }); } if($(".banner .swiper-slide").length>1){ $(".banner .swiper-button-next,.swiper-button-prev").removeclass("rmdk"); var bannerswiper = new swiper('.banner .swiper-container', { slidesperview: 1, loop: true, autoplay: { delay: 2500, disableoninteraction: false, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } if($(".banner").length>0){ bannerswiper.el.onmouseover = function () { bannerswiper.autoplay.stop(); } bannerswiper.el.onmouseout = function () { bannerswiper.autoplay.start(); } } // 通知公告 var newsletterswiper = new swiper('.txtscroll-left', { slidesperview: 1, loop: true, autoplay: { delay: 2500, disableoninteraction: false, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); newsletterswiper.el.onmouseover = function () { newsletterswiper.autoplay.stop(); } newsletterswiper.el.onmouseout = function () { newsletterswiper.autoplay.start(); } // 股票 // var elements = hq_str_hk03996.split(","); // var nowvalue = elements[6]; // var nnowvalue = new number(nowvalue).tofixed(2); // var changevalue1 = elements[8]; // var nchangevalue1 = new number(changevalue1).tofixed(2); // if (changevalue1 >= 0) { // $(".gp-dqj")[0].innerhtml = nnowvalue + '(hkt)'; // $(".gp-zdf")[0].innerhtml = nchangevalue1 + ' %'; // } else { // $(".gp-dqj")[0].innerhtml = nnowvalue + '(hkt)'; // $(".gp-zdf")[0].innerhtml = nchangevalue1 + ' %'; // $(".gp-zdf").css("color", "#1db336"); // $(".gp-dqj").css({ // "color": "#1db336", // "background": "url(/picture/886/2109071056309479229.png)no-repeat right", // "background-size": "contain" // }); // } // 新闻资讯 $(".xwzx-title").each(function () { $(this).find("li:first-child").addclass("active"); $(this).next(".xwzx-m").find("li:first-child").addclass("block"); }) // 轮播 var xwswiper = new swiper('.picscrolls1', { slidesperview: 1, loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); if ($(window).width() <= 768) { var dian = -$(".xwzx-lf .swiper-pagination").width() / 2; $(".xwzx-lf .swiper-pagination").css("margin-left", dian) } // 新闻列表 var tabitem = $('.tab .xwzx-title li'); var tabitems = $('.tab .xwzx-m li'); var xwzxswiper = new swiper('.xwzx-rt .swiper-containers', { autoplay: false, simulatetouch:true, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 changetab(n); } } }) //tab点击切换silde tabitem.hover(function () { var ind = $(this).index(); changetab(ind); xwzxswiper.slideto(ind); }) //tab切换样式 function changetab(index) { tabitem.removeclass('active').eq(index).addclass('active'); tabitems.removeclass('block').eq(index).addclass('block'); } // 专题专栏 var wid = $(window).width(); if (wid <= 480) { var slideboxswiper = new swiper('.swiper-container.slidebox', { slidesperview: 2, loop: true, spacebetween: 10, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } else { if($(".sy .ztzl-list .swiper-slide").length > 2 ){ var slideboxswiper = new swiper('.swiper-container.slidebox', { slidesperview: 3, loop: true, spacebetween: 10, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } } // 主营业务 /* $(".zyyw-lf ul").each(function () { $(this).find("li:first-child").addclass("active"); $(this).find(".active").css("opacity", "1"); }) if ($(window).width() > 768) { $(".zyyw-lf ul li").hover(function () { $(this).addclass("active").siblings().removeclass("active"); // if ($(this)[0].style.opacity == "") { // fadein($(this), 1) // } // $(this).siblings().css("opacity", "") var index = $(this).index(); $(this).parents(".zyyw-lf").next(".zyyw-rt").find(".swiper-slide").eq(index).show().siblings().hide(); }) // function fadein(element, speed) { // var speed = speed || 30; // var num = 0; // var st = setinterval(function () { // num++; // element[0].style.opacity = num / 100; // if (num >= 100) { // clearinterval(st); // } // }, speed); // } } if ($(window).width() <= 768) { var zyyw = $('.zyyw-lf ul li'); var zyywswiper = new swiper('.zyyw-rt', { autoplay: false, loop: true, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex - 1;//过渡后的slide索引 if (n == 6) { changetabs(0); } else { changetabs(n); } } } }) zyyw.click(function () { var ind = $(this).index(); changetabs(ind); zyywswiper.slideto(ind + 1); }) function changetabs(index) { zyyw.removeclass('active').eq(index).addclass('active'); } }*/ // 主营业务 $(".zyyw-lf ul").each(function () { $(this).find("li:first-child").addclass("active"); $(this).find(".active").css("opacity", "1"); }) if ($(window).width() > 768) { $(".zyyw-lf ul li").hover(function () { $(this).addclass("active").siblings().removeclass("active"); // if ($(this)[0].style.opacity == "") { // fadein($(this), 1) // } // $(this).siblings().css("opacity", "") var index = $(this).index(); $(this).parents(".zyyw-lf").next(".zyyw-rt").find(".swiper-slide").eq(index).show().siblings().hide(); }) // function fadein(element, speed) { // var speed = speed || 30; // var num = 0; // var st = setinterval(function () { // num++; // element[0].style.opacity = num / 100; // if (num >= 100) { // clearinterval(st); // } // }, speed); // } } if ($(window).width() <= 768) { var zyyw = $('.zyyw-lf ul li'); var zyywswiper = new swiper('.zyyw-rt', { autoplay: false, loop: true, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex - 1;//过渡后的slide索引 if (n == 6) { changetabs(0); } else { changetabs(n); } } } }) zyyw.click(function () { var ind = $(this).index(); changetabs(ind); zyywswiper.slideto(ind + 1); }) function changetabs(index) { zyyw.removeclass('active').eq(index).addclass('active'); } } // 企业推介 $(".qytj-title").each(function () { $(this).find("li:first-child").addclass("active"); $(this).next(".qytj-m").find("li:first-child").addclass("block"); }) if ($(window).width() <= 768) { $(".qytj-list").find("li:first-child").removeclass("active") } // 左侧 var qytjlf = $('.content4-lf .qytj-title li'); var qytjlfs = $('.content4-lf .qytj-m li'); var qytjlfswiper = new swiper('.content4-lf .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 qytjlftab(n); } } }) qytjlf.hover(function () { var ind = $(this).index(); qytjlftab(ind); qytjlfswiper.slideto(ind); }) function qytjlftab(index) { qytjlf.removeclass('active').eq(index).addclass('active'); qytjlfs.removeclass('block').eq(index).addclass('block'); } // 右侧 var qytjrt = $('.content4-rt .qytj-title li'); var qytjrts = $('.content4-rt .qytj-m li'); var qytjrtswiper = new swiper('.content4-rt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 qytjrttab(n); } } }) qytjrt.hover(function () { var ind = $(this).index(); qytjrttab(ind); qytjrtswiper.slideto(ind); }) function qytjrttab(index) { qytjrt.removeclass('active').eq(index).addclass('active'); qytjrts.removeclass('block').eq(index).addclass('block'); } // 图片中心 $(".pic-title").each(function () { $(this).find("li:first-child").addclass("active"); $(this).next(".pic-m").find("li:first-child").addclass("block"); }) var pic = $('.content5 .pic-title li'); var pics = $('.content5 .pic-m li'); var picswiper = new swiper('.content5 .swiper-containers', { autoplay: false, autoheight: true, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 pictab(n); } } }) pic.hover(function () { var ind = $(this).index(); pictab(ind); picswiper.slideto(ind); }) function pictab(index) { pic.removeclass('active').eq(index).addclass('active'); pics.removeclass('block').eq(index).addclass('block'); } } // ---------------------------------- 企业推介-------------------------------------------------------------// if ($("body.qytj").length == 1) { // 企业推介子栏目 $(".content-nav").each(function () { $(this).find("li:first-child").addclass("active"); $(this).find(".active").css("opacity", "1"); }) if ($(window).width() <= 768) { var qytj = $('.content-nav li'); var qytjswiper = new swiper('.content-detail', { autoplay: false, loop: true, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex - 1;//过渡后的slide索引 if (n == 4) { qytjtab(0); } else { qytjtab(n); } } } }) qytj.hover(function () { var ind = $(this).index(); qytjtab(ind); qytjswiper.slideto(ind + 1); }) function qytjtab(index) { qytj.removeclass('active').eq(index).addclass('active'); qytj.css("opacity", "1") } } else { $(".content-nav li").hover(function () { $(this).addclass("active").siblings().removeclass("active"); $(this).css("opacity", "1") var index = $(this).index(); $(this).parents(".content-nav").next(".content-detail").find("li").eq(index).show().siblings().hide(); }) } } // ---------------------------------- 主营业务-------------------------------------------------------------// if ($("body.zyyws").length == 1) { $('.fold_wrap li').mouseover(function(){ $(this).children().children('.pic_auto').addclass('on').parent().parent().siblings("li").children().children('.pic_auto').removeclass('on') }).mouseout(function(){ $('.fold_wrap li').children().children('.pic_auto').removeclass('on'); }) // 主营业务子栏目 if ($(window).width() <= 540) { $(".zyyw > ul").each(function () { $(this).find("li:nth-child(2n+2)").css("margin-right", "0") }) } else { $(".zyyw > ul").each(function () { $(this).find("li:nth-child(3n+3)").css("margin-right", "0") }) } if ($(window).width() <= 768) { $(".zyyw > ul li").click(function () { if ($(this).find(".zyyw-li")[0].style.top == "" || $(this).find(".zyyw-li")[0].style.top == "100%") { $(this).siblings().find(".zyyw-li").css("top", "100%") $(this).siblings().css("background", "#f4f7f9 url(images/zyyw-foot.png) no-repeat left bottom") $(this).css("background", "#f4f7f9 url(images/zyyw-foots.png) no-repeat left bottom") $(this).find(".zyyw-li").css("top", "0px") } else { $(this).css("background", "#f4f7f9 url(images/zyyw-foot.png) no-repeat left bottom") $(this).find(".zyyw-li").css("top", "100%") } }) } else { $(".zyyw > ul li").hover(function () { $(this).css("background", "#f4f7f9 url(images/zyyw-foots.png) no-repeat left bottom") $(this).find(".zyyw-li").css("top", "0") }, function () { $(this).css("background", "#f4f7f9 url(images/zyyw-foot.png) no-repeat left bottom") $(this).find(".zyyw-li").css("top", "100%") }) } } // ---------------------------------- 新闻资讯-------------------------------------------------------------// if ($("body.xwzxs").length == 1) { // 删除阻止移动端滑动的样式 if ($(window).width() <= 768) { $(".swiper-no-swiping").removeclass("swiper-no-swiping") } // 删除企业新闻 if ($(window).width() <= 768) { // $(".xwzx-rt .xwzx-title li:first-child").remove() // $(".xwzx-rt .xwzx-m li:first-child").remove() $(".xwzx-rt .swiper-wrapper .swiper-slide:last-child").remove() } // 添加class名 $(".xwzx-title").each(function () { $(this).find("li:first-child").addclass("active"); $(".xwzx-rt .swiper-slide:first-child .xwzx-list").find("li:first-child").addclass("hot"); $(this).next(".xwzx-m").find("li:first-child").addclass("block"); }) if ($(window).width() <= 768) { $(".xwzx-rt .swiper-slide:first-child .xwzx-list").find("li:first-child").removeclass("hot") } // 新闻资讯 // 轮播 var xwswiper = new swiper('.picscrolls1', { slidesperview: 1, loop: true, pagination: { el: '.swiper-pagination', clickable: true, }, }); // 新闻列表 var xwzxrt = $('.xwzx-rt .xwzx-title li'); var xwzxrts = $('.xwzx-rt .xwzx-m li'); var xwzxrtswiper = new swiper('.xwzx-rt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 xwzxrttab(n); } } }) xwzxrt.hover(function () { var ind = $(this).index(); xwzxrttab(ind); xwzxrtswiper.slideto(ind); }) function xwzxrttab(index) { xwzxrt.removeclass('active').eq(index).addclass('active'); xwzxrts.removeclass('block').eq(index).addclass('block'); } // 基层动态 var jcdt = $('.jcdt .xwzx-title li'); var jcdts = $('.jcdt .xwzx-m li'); var jcdtswiper = new swiper('.jcdt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 jcdttab(n); } } }) jcdt.hover(function () { var ind = $(this).index(); jcdttab(ind); jcdtswiper.slideto(ind); }) function jcdttab(index) { jcdt.removeclass('active').eq(index).addclass('active'); jcdts.removeclass('block').eq(index).addclass('block'); } // 媒体聚焦 var mtjj = $('.mtjj .xwzx-title li'); var mtjjs = $('.mtjj .xwzx-m li'); var mtjjswiper = new swiper('.mtjj .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 mtjjtab(n); } } }) mtjj.hover(function () { var ind = $(this).index(); mtjjtab(ind); mtjjswiper.slideto(ind); }) function mtjjtab(index) { mtjj.removeclass('active').eq(index).addclass('active'); mtjjs.removeclass('block').eq(index).addclass('block'); } // 专题专栏 var wid = $(window).width(); if (wid <= 480) { var slideboxswiper = new swiper('.slidebox', { slidesperview: 2, loop: true, spacebetween: 10, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } else { var slideboxswiper = new swiper('.slidebox', { slidesperview: 3, loop: true, spacebetween: 10, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } // 行业资讯 var hyzx = $('.content3-lf .xwzx-title li'); var hyzxs = $('.content3-lf .xwzx-m li'); var hyzxswiper = new swiper('.content3-lf .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 hyzxlftab(n); } } }) hyzx.hover(function () { var ind = $(this).index(); hyzxlftab(ind); hyzxswiper.slideto(ind); }) function hyzxlftab(index) { hyzx.removeclass('active').eq(index).addclass('active'); hyzxs.removeclass('block').eq(index).addclass('block'); } // 员工风采 var ygfc = $('.content3-rt .xwzx-title li'); var ygfcs = $('.content3-rt .xwzx-m li'); var ygfcswiper = new swiper('.content3-rt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 ygfctab(n); } } }) ygfc.hover(function () { var ind = $(this).index(); ygfctab(ind); ygfcswiper.slideto(ind); }) function ygfctab(index) { ygfc.removeclass('active').eq(index).addclass('active'); ygfcs.removeclass('block').eq(index).addclass('block'); } // 图片中心 $(".pic-title").each(function () { $(this).find("li:first-child").addclass("active"); $(this).next(".pic-m").find("li:first-child").addclass("block"); }) var pic = $('.content4 .pic-title li'); var pics = $('.content4 .pic-m li'); var picswiper = new swiper('.content4 .swiper-containers', { autoplay: false, autoheight: true, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 pictab(n); } } }) pic.hover(function () { var ind = $(this).index(); pictab(ind); picswiper.slideto(ind); }) function pictab(index) { pic.removeclass('active').eq(index).addclass('active'); pics.removeclass('block').eq(index).addclass('block'); } } // ---------------------------------- 主营业务-------------------------------------------------------------// if ($("body.zyyws").length == 1) { $(".zyyw-title").each(function () { $(this).find("li:first-child").addclass("active"); }) var zyyw = $('.zyyw-content .zyyw-title li'); var zyywswiper = new swiper('.zyyw-text', { autoplay: false, autoheight: true, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 zyywtab(n); } } }) zyyw.hover(function () { var ind = $(this).index(); zyywtab(ind); zyywswiper.slideto(ind); }) function zyywtab(index) { zyyw.removeclass('active').eq(index).addclass('active'); } } // ---------------------------------- 信息公开-------------------------------------------------------------// if ($("body.xxgk").length == 1) { // 删除阻止移动端滑动的样式 if ($(window).width() <= 768) { $(".swiper-no-swiping").removeclass("swiper-no-swiping") } // 添加class名 $(".xxgk-title").each(function () { $(this).find("li:first-child").addclass("active"); $(this).next(".xxgk-m").find("li:first-child").addclass("block"); }) // 企业基本信息 // 自适应高度 if ($(window).width() <= 768) { $(".xxgk .jbxx-txt .gsxx td").each(function (index, obj) { $(".xxgk .jbxx-txt .gsxx th")[index].style.height = $(obj).innerheight() + "px" $(".xxgk .jbxx-txt .gsxx th")[index].style.lineheight = $(obj).innerheight() + "px" }); } var jbxx = $('.jbxx-sub li'); var oswiper = new swiper('#o-c', { autoheight: true, autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 jbxxtab(n); }, settransition: function (swiper) { if (this.activeindex == 1) { oswiper.allowtouchmove = false; // oswiper.mousewheel.enable(); } else { oswiper.allowtouchmove = true; // oswiper.mousewheel.disable(); } } } }) var iswiper = new swiper('#i-c1', { scrollbar: { el: '.swiper-scrollbar', }, slidesperview: 'auto', freemode: true, freemodemomentum: false, mousewheelsensitivity: 0.5, on: { settransition: function (swiper, translate) { //translate 一直为0,不可直接用 nowtranslate = swiper.translate; if (typeof (beforetranslate) == "undefined") { beforetranslate = 0 } ; slidewidth = iswiper.slides[0].scrollwidth; swiperwidth = iswiper.width if (nowtranslate > -2 && nowtranslate > beforetranslate) { oswiper.slideto(0); } if (slidewidth - swiperwidth + nowtranslate < 2 && nowtranslate < beforetranslate) { oswiper.slideto(2); } beforetranslate = nowtranslate; }, touchend: function (swiper) { if (iswiper.translate > 0) { oswiper.slideto(0); } if (iswiper.translate < (iswiper.width - iswiper.slides[0].scrollwidth)) { oswiper.slideto(2); } } } }); jbxx.hover(function () { var ind = $(this).index(); jbxxtab(ind); oswiper.slideto(ind); }) $('.jbxx-sub li').eq(0).addclass('active'); function jbxxtab(index) { jbxx.removeclass('active').eq(index).addclass('active'); } // 重要人事变动 电子采购平台 var jcdt = $('.jcdt .xxgk-title li'); var jcdts = $('.jcdt .xxgk-m li'); var jcdtswiper = new swiper('.jcdt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 jcdttab(n); } } }) jcdt.hover(function () { var ind = $(this).index(); jcdttab(ind); jcdtswiper.slideto(ind); }) function jcdttab(index) { jcdt.removeclass('active').eq(index).addclass('active'); jcdts.removeclass('block').eq(index).addclass('block'); } // 改制与重组 产权转让及增资 var mtjj = $('.mtjj .xxgk-title li'); var mtjjs = $('.mtjj .xxgk-m li'); var mtjjswiper = new swiper('.mtjj .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 mtjjtab(n); } } }) mtjj.hover(function () { var ind = $(this).index(); mtjjtab(ind); mtjjswiper.slideto(ind); }) function mtjjtab(index) { mtjj.removeclass('active').eq(index).addclass('active'); mtjjs.removeclass('block').eq(index).addclass('block'); } // 社会责任报告 var wid = $(window).width(); if (wid <= 480) { var slideboxswiper = new swiper('.slidebox', { slidesperview: 2, loop: true, spacebetween: 10, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } else if (wid <= 768) { var slideboxswiper = new swiper('.slidebox', { slidesperview: 3, loop: true, spacebetween: 10, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } else { var slideboxswiper = new swiper('.slidebox', { slidesperview: 5, loop: true, spacebetween: 22, navigation: { nextel: '.swiper-button-next', prevel: '.swiper-button-prev', }, }); } } // ---------------------------------- 投资者关系-------------------------------------------------------------// if ($("body.tzzgx").length == 1) { // 删除阻止移动端滑动的样式 if ($(window).width() <= 768) { $(".swiper-no-swiping").removeclass("swiper-no-swiping") } // 添加class名 $(".tzzgx-title").each(function () { $(this).find("li:first-child").addclass("active"); $(this).next(".tzzgx-m").find("li:first-child").addclass("block"); }) $(".qxt-title").each(function () { $(this).find("li:first-child").addclass("active"); }) // 股价 var elements = hq_str_hk03996.split(","); var time = elements[17] + ' ' + elements[18]; var name = elements[1] + '(03996.hk)'; var changevalue = new number(elements[8]).tofixed(2); var chajia = math.round(elements[7] * 10000) / 10000; var yestoday = elements[3]; var zuigao = elements[4]; var low = elements[5]; var amount = elements[12] + '手'; var nowvalue = elements[6]; document.getelementbyid('time').innerhtml = time; document.getelementbyid('name').innerhtml = name; document.getelementbyid('yestoday').innerhtml = yestoday; document.getelementbyid('zuigao').innerhtml = zuigao; document.getelementbyid('low').innerhtml = low; document.getelementbyid('amount').innerhtml = amount; if (changevalue >= 0) { document.getelementbyid('nowvalue').innerhtml = nowvalue; document.getelementbyid('chajia').innerhtml = '+' + chajia; document.getelementbyid('changevalue').innerhtml = '+' + changevalue + '%'; } else { document.getelementbyid('nowvalue').innerhtml = nowvalue; document.getelementbyid('chajia').innerhtml = chajia; document.getelementbyid('changevalue').innerhtml = changevalue + '%'; $("#nowvalue").css({ "color": "#1db336", "background": "url(/picture/886/2109071056309479229.png)no-repeat right" }) $("#changevalue").css("color", "#1db336") $("#chajia").css("color", "#1db336") } // 股票信息 var qxt = $('.qxt-title li'); var qxtswiper = new swiper('.tzzgx-rt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 qxttab(n); } } }) qxt.hover(function () { var ind = $(this).index(); qxttab(ind); qxtswiper.slideto(ind); }) function qxttab(index) { qxt.removeclass('active').eq(index).addclass('active'); } // 公告及通函 定期报告 证券变动月报表 var jcdt = $('.jcdt .tzzgx-title li'); var jcdts = $('.jcdt .tzzgx-m li'); var jcdtswiper = new swiper('.jcdt .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 jcdttab(n); } } }) jcdt.hover(function () { var ind = $(this).index(); jcdttab(ind); jcdtswiper.slideto(ind); }) function jcdttab(index) { jcdt.removeclass('active').eq(index).addclass('active'); jcdts.removeclass('block').eq(index).addclass('block'); } // 分析师研报 投资者服务 var mtjj = $('.mtjj .tzzgx-title li'); var mtjjs = $('.mtjj .tzzgx-m li'); var mtjjswiper = new swiper('.mtjj .swiper-containers', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 mtjjtab(n); } } }) mtjj.hover(function () { var ind = $(this).index(); mtjjtab(ind); mtjjswiper.slideto(ind); }) function mtjjtab(index) { mtjj.removeclass('active').eq(index).addclass('active'); mtjjs.removeclass('block').eq(index).addclass('block'); } } // ---------------------------------- 栏目页-------------------------------------------------------------// if ($("#lanmu").length == 1) { if ($(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").length > 0) { $(".lanmu-siji").show() $(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).show() var nub = $(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").length if (nub <= 4) { $(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").width(100 / nub + "%") } else { $(".lanmu-siji ul").eq($(".lanmu-sanji .active").index()).find("li").width("25%") } } // $(document).ready(function () { // function lanmuheiht() { // $(".lanmu-lf").height($(".lanmu-rt").height()+"px") // } // setinterval(lanmuheiht,50); // }); $(".ldr-name").click(function () { var num = $(this).parents("li").index() $(this).parents(".lanmu-ldr").next(".ldr-wz").show() $(".background").show() $(this).parents(".lanmu-ldr").next(".ldr-wz").find("li").eq(num).show().siblings().hide() var height = $(this).parents(".lanmu-ldr").next(".ldr-wz").innerheight() $(this).parents(".lanmu-ldr").next(".ldr-wz").css("margin-top", -height / 2) }) $('.close12').bind('click', function () { $('.ldr-wz').hide(); $('.background').hide(); }); // 投资者关系 if ($(".lanmu-tzzgx").length == 2) { // 股价 var elements = hq_str_hk03996.split(","); var time = elements[17] + ' ' + elements[18]; var name = elements[1] + '(03996.hk)'; var changevalue = new number(elements[8]).tofixed(2); var chajia = math.round(elements[7] * 10000) / 10000; var yestoday = elements[3]; var zuigao = elements[4]; var low = elements[5]; var amount = elements[12] + '手'; var nowvalue = elements[6]; document.getelementbyid('time').innerhtml = time; document.getelementbyid('name').innerhtml = name; document.getelementbyid('yestoday').innerhtml = yestoday; document.getelementbyid('zuigao').innerhtml = zuigao; document.getelementbyid('low').innerhtml = low; document.getelementbyid('amount').innerhtml = amount; if (changevalue >= 0) { document.getelementbyid('nowvalue').innerhtml = nowvalue; document.getelementbyid('chajia').innerhtml = '+' + chajia; document.getelementbyid('changevalue').innerhtml = '+' + changevalue + '%'; } else { document.getelementbyid('nowvalue').innerhtml = nowvalue; document.getelementbyid('chajia').innerhtml = chajia; document.getelementbyid('changevalue').innerhtml = changevalue + '%'; $("#nowvalue").css({ "color": "#1db336", "background": "url(/picture/886/2109071056309479229.png)no-repeat right" }) $("#changevalue").css("color", "#1db336") $("#chajia").css("color", "#1db336") } var qxt = $('.qxt-title li'); var qxtswiper = new swiper('.tzzgx-txt', { autoplay: false, on: { //swiper从当前slide开始过渡到另一个slide时执行 slidechangetransitionstart: function () { var n = this.activeindex;//过渡后的slide索引 qxttab(n); } } }) qxt.hover(function () { var ind = $(this).index(); qxttab(ind); qxtswiper.slideto(ind); }) function qxttab(index) { qxt.removeclass('active').eq(index).addclass('active'); } } } // ---------------------------------- 网站地图-------------------------------------------------------------// if ($(".wzdt").length > 1) { $(".wzdt-ej").each(function () { $(this).find("li").each(function () { var index = $(this).index() $(this).parents(".wzdt-ej").next(".wzdt-sj").find("ul").eq(index).css("display", "block") var eheight = $(this).height() var sheight = $(this).parents(".wzdt-ej").next(".wzdt-sj").find("ul").eq(index).height() if (eheight > sheight) { $(this).parents(".wzdt-ej").next(".wzdt-sj").find("ul").eq(index).height(eheight) } else { $(this).height(sheight) } }) }) } })