//瀹氬埗 if (window.screen.height == 1080) { $('.pc_body').addClass('high_body') } //宸︿晶鍥哄畾寮瑰眰鍏抽棴 $('.js_gov_fixed_left').on('click', '.close', function(ev){ ev.stopPropagation() $(this).parents('.js_gov_fixed_left').hide() }) // pc 鏂伴椈 swiper var bannerSlider = $(".js_banner").oSlider({ loop: true, pager: ".js_pager", pagerHover: false, windowResize: true, speed: 3000, startFn: function () { // console.log("寮€濮?); }, playFn: function () { // console.log("play"); } }); bannerSlider.init(); $(".js_pagePrev").on("click", function (e) { e.preventDefault(); bannerSlider.prev(); }) $(".js_pageNext").on("click", function (e) { e.preventDefault(); bannerSlider.next(); }) //淇敼涓洪紶鏍囩Щ鍔ㄥ垏鎹 $(".js_tab1").on("mouseover", ".js_title li", function () { $(this).addClass("cur").siblings().removeClass('cur'); var i = Math.max($(this).index() - 1, 0); $(this).parents(".js_tab1").find(".js_tabbox").eq(i).addClass("cur").siblings().removeClass('cur'); }); //tab鍒囨崲 鏇存敼涓篽over鏁堟灉 $('.js_tab_box').on('mouseover', '.tab_nav_item', function () { $(this).addClass('cur').siblings().removeClass('cur') $(this).parent().siblings('.tab_list').find('ul').removeClass('cur').eq($(this).index()).addClass('cur') }) $('.js_tab_box_1').on('hover', '.tab_nav a', function () { if ($(this).index() < 2) { $(this).addClass('cur').siblings().removeClass('cur') $(this).parent().siblings('.tab_list').find('ul').removeClass('cur').eq($(this).index()).addClass('cur') } }) //搴曢儴杞挱 $(".js_part6_banner").each(function () { $(this).oSlider({ pager: ".opager" }).init(); }); var homepageNewTipsTimer; function createTimer() { homepageNewTipsTimer = window.setTimeout(function () { closeHomepageNewTips() }, 20000) } function openHomepageNewTips() { $('.js_new_tips').animate({ 'bottom': 0 }, 1000, createTimer()) } function closeHomepageNewTips() { $('.js_new_tips').animate({ 'bottom': -166 + 'px' }, 1000) } $(document).ready(function () { // 鍏抽棴鏂板勾蹇箰鎻愮ず鎸夐挳 function createTimer() { happyTimer = window.setTimeout(function () { closehappy() }, 30000) } function openhappy() { var kuandu=$(window).width(); if(kuandu>750){ $('.js_happynewyear').animate({ 'right': 20 + 'px' }, 1000, createTimer()) }else{ $('.js_happynewyear').animate({ 'bottom': 0 + 'px' }, 1000, createTimer()) } } function closehappy() { var kuandu=$(window).width(); if(kuandu>750){ $('.js_happynewyear').animate({ 'right': -160 + 'px' }, 1000) }else{ $('.js_happynewyear').animate({ 'bottom': -260 + 'px' }, 1000, createTimer()) } } // 鍏堣幏鍙栨墍闇€瑕佺殑鍦板潃鏍忓弬鏁 secondclass锛氫簩绾у垎绫 secondspecial锛氬叿浣撳垎绫 function getQueryVariable(variable) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return pair[1]; } } return (false); } if ($(".js_happynewyear").length > 0) { // 闅愯棌娓╅Θ鎻愮ず if($(".js_new_tips").length>0){ $(".js_new_tips").addClass("hidethis"); } openhappy(); $('.js_closehappy').on('click', function () { closehappy() clearTimeout(happyTimer) }) } // 鏂板勾绁濈 娴嬭瘯 // if ($(".js_happynewyear").length > 0) { // var ifshownew = decodeURIComponent(getQueryVariable("new")); // if (ifshownew == "true") { // $(".js_happynewyear").addClass("showthis"); // $(".js_new_tips").addClass("hidethis"); // openhappy(); // $('.js_closehappy').on('click', function () { // closehappy() // clearTimeout(happyTimer) // }) // } // } openHomepageNewTips() $('.js_new_tips_close').on('click', function () { closeHomepageNewTips() clearTimeout(homepageNewTipsTimer) }) var homephoneSlider = $(".js_homephonebanner").oSlider({ loop: true, pager: ".js_homephonepage", pagerHover: false, windowResize: false, speed: 3000, startFn: function () { // console.log("寮€濮?); }, playFn: function () { // console.log("play"); } }); homephoneSlider.init(); // 鏀垮姟鍏紑 鍏憡鍏ず $(".homepage_phone .tabqiehuan").on("click", ".js_kexuan", function (e) { e.preventDefault(); var $this = $(this); var index = $this.index(); var thishref = $this.attr("href"); if ($this.hasClass("cur")) { window.open(thishref); } else { $this.addClass("cur").siblings(".js_kexuan").removeClass('cur'); $this.parents(".title").siblings(".list_box").find(".list").eq(index).addClass("cur").siblings(".list").removeClass('cur'); } }) // 涓汉浼佷笟鍔炰簨 $(".homepage_phone .banshi").on("click", ".js_banshitab", function () { var $this = $(this); var index = $this.index(); $this.addClass("cur").siblings(".js_banshitab").removeClass('cur'); $this.parents(".title").siblings(".banshilistbox").find(".banshilist").eq(index).addClass("cur").siblings(".banshilist").removeClass('cur'); }) // 鏀跨瓥 鏂囦欢 瑙h 鏂伴椈鍙戝竷浼 $(".homepage_phone .wenjianjiedufabu").on("click", ".js_sanheyi", function (e) { e.preventDefault(); var $this = $(this); var index = $this.index(); var thishref = $this.attr("href"); // 绗笁涓壒娈 鐩存帴璺 if (index >= 2) { window.open(thishref); } else { if ($this.hasClass("cur")) { window.open(thishref); } else { $this.addClass("cur").siblings(".js_sanheyi").removeClass('cur'); $this.parents(".title").siblings(".listbox").find(".list").eq(index).addClass("cur").siblings(".list").removeClass('cur'); } } }) // 涓撻涓撴爮 // 涓撻涓撴爮 swiper var lastSlider = $(".js_lastbanner").oSlider({ loop: true, pager: ".js_lastpager", pagerHover: false, windowResize: false, // speed:3000, startFn: function () { // console.log("寮€濮?); }, playFn: function () { // console.log("play"); } }); lastSlider.init(); $(".js_pagePrevlast").on("click", function (e) { e.preventDefault(); lastSlider.prev(); }) $(".js_pageNextlast").on("click", function (e) { e.preventDefault(); lastSlider.next(); }) }); // 绐楀彛鍑芥暟鏀瑰彉鎵ц鐨 $(window).resize(function () { var widthnow = $(window).width(); var heigthnow = $(window).height(); });