; $(function() { $(".dropdown-toggle").off("click").on("click", function() { return $("#zy2_search_box").slideToggle("100"), $("#zy2_search_box input[type='text']").focus() }); $(".zy2_hasmore>a").on("click", function() { var a = $(this).parent().children("ul").first(), b = $(this).parent(); return $(".zy2_hasmore").each(function(n, i) { n == b.attr("data-index") ? ($(this).parent().addClass("active"), "none" == a.css("display") ? a.slideDown(500) : a.slideUp(500)) : ($(this).parent().removeClass("active"), "block" == $(i).children("ul").first().css("display") && $(i).children("ul").first().slideUp()) }) }); $("#footer .visible-xs .col-sm-3 label.hasmenu").on("click", function(e) { $label = $(e.target), $ul = $label.next(), "none" == $ul.css("display") ? ($ul.slideDown("1000"), $label.addClass("active")) : "block" == $ul.css("display") && ($ul.slideUp("1000"), $label.removeClass("active")) }); $("#zy2_masthead_wrap").on("click", "#mob_menuitem", function() { navclick("open") }); $("#zy2_masthead_wrap").on("click", "#zy2_mob_nav_close", function() { navclick("close") }); $(".all-pro").hover(function() { $(".nav-all-app").hide(); $(".nav-all-pro").stop().slideDown(500); $('#zy2_masthead_wrap').addClass('zy2_nhb'); $('#zy2_masthead_wrap').removeClass('zy2_zhb'); $('#zy2_logo').addClass('zy2_nlogo'); $('.zy2_search').addClass('zy2_nhb2') }, function() { $('#zy2_logo').removeClass('zy2_nlogo'); $('#zy2_masthead_wrap').addClass('zy2_zhb'); $('#zy2_masthead_wrap').removeClass('zy2_nhb'); $('.zy2_search').removeClass('zy2_nhb2'); $(".nav-all-pro").stop().slideUp(500) }); $(".nav-all-pro").hover(function() { $(".nav-all-app").hide(); $('#zy2_masthead_wrap').addClass('zy2_nhb'); $('#zy2_masthead_wrap').removeClass('zy2_zhb'); $('#zy2_logo').addClass('zy2_nlogo'); $('.zy2_search').addClass('zy2_nhb2'); $(this).stop().slideDown(500) }, function() { $('#zy2_logo').removeClass('zy2_nlogo'); $('#zy2_masthead_wrap').addClass('zy2_zhb'); $('#zy2_masthead_wrap').removeClass('zy2_nhb'); $('.zy2_search').removeClass('zy2_nhb2'); $(this).stop().slideUp(500) }); $(".all-app").hover(function() { $(".nav-all-pro").hide(); $(".nav-all-app").stop().slideDown(500); $('#zy2_masthead_wrap').addClass('zy2_nhb'); $('#zy2_masthead_wrap').removeClass('zy2_zhb'); $('#zy2_logo').addClass('zy2_nlogo'); $('.zy2_search').addClass('zy2_nhb2') }, function() { $('#zy2_logo').removeClass('zy2_nlogo'); $('#zy2_masthead_wrap').addClass('zy2_zhb'); $('#zy2_masthead_wrap').removeClass('zy2_nhb'); $('.zy2_search').removeClass('zy2_nhb2'); $(".nav-all-app").stop().slideUp(500) }); $(".nav-all-app").hover(function() { $(".nav-all-pro").hide(); $('#zy2_masthead_wrap').addClass('zy2_nhb'); $('#zy2_masthead_wrap').removeClass('zy2_zhb'); $('#zy2_logo').addClass('zy2_nlogo'); $('.zy2_search').addClass('zy2_nhb2'); $(this).stop().slideDown(500) }, function() { $('#zy2_logo').removeClass('zy2_nlogo'); $('#zy2_masthead_wrap').addClass('zy2_zhb'); $('#zy2_masthead_wrap').removeClass('zy2_nhb'); $('.zy2_search').removeClass('zy2_nhb2'); $(this).stop().slideUp(500) }); $('#zy2_masthead_wrap').hover(function() { $('#zy2_masthead_wrap').addClass('zy2_zhb') }, function() { $('#zy2_masthead_wrap').removeClass('zy2_zhb') }); huxi(300, 6000); $('.lunbo>ol>li:first-child').addClass('current'); if ($(".lunbo>ul>li").length < 2) { $(".lunbo>span").remove() }; if ($(".lunbo>ul>li").length < 2) { $(".lunbo>ol").hide() }; Yszie(); $(window).resize(function() { Yszie() }) }); function navclick(e) { e == "open" ? ($("#container,#footer").addClass("open"), $("#footer").css("top", $("#container").height()), $("#zy2_mob_nav_container").addClass("open")) : ($("#footer").css("top", "initial"), $("#zy2_mob_nav_container").removeClass("open"), $("#container, #footer").removeClass("open")) } function Yszie() { var Y_witdh, xwidth, src_txt; $(window).width() <= window.innerWidth ? Y_witdh = window.innerWidth: Y_witdh = $(window).width(), $("#zy2_search_box").appendTo($(".zy2_search")), Y_witdh >= 1024 ? ($("#zy2_search_box").removeAttr("style"), navclick("close")) : ($("#zy2_search_box").insertAfter($("#zy2_masthead_wrap")), $("#zy2_search_box").css("width", $(window).width())); xwidth = $(window).width(); if (xwidth < "768") { $(".yang_carousel").each(function() { src_txt = $(this).attr('alt'); $(this).css('background-size', '100% 100%'); $(this).css("background-image", "url(/images/small_banner/" + src_txt + ")"); (xwidth < 520) ? ($('#video1').attr('width', '300'), $('#video1').attr('height', '170')) : ($('#video1').attr('width', '500'), $('#video1').attr('height', '280')), (xwidth < 520) ? ($('#video2').attr('width', '300'), $('#video2').attr('height', '170')) : ($('#video2').attr('width', '500'), $('#video2').attr('height', '280')), (xwidth < 520) ? ($('#video3').attr('width', '300'), $('#video3').attr('height', '170')) : ($('#video3').attr('width', '500'), $('#video3').attr('height', '280')) }) } else if (xwidth < "1921") { $(".yang_carousel").each(function() { src_txt = $(this).attr('alt'); $(this).css("background", "url(/images/banner/" + src_txt + ") center center no-repeat"), $(this).css('background-size', '1920px 766px'); $('#video1').attr('width', '712'), $('#video1').attr('height', '400'), $('#video2').attr('width', '712'), $('#video2').attr('height', '400'), $('#video3').attr('width', '712'), $('#video3').attr('height', '400') }) }else { $(".yang_carousel").each(function() { src_txt = $(this).attr('alt'); $(this).css("background", "url(/images/big_banner/" + src_txt + ") center center no-repeat"), $(this).css('background-size', '2560px 766px'); $('#video1').attr('width', '712'), $('#video1').attr('height', '400'), $('#video2').attr('width', '712'), $('#video2').attr('height', '400'), $('#video3').attr('width', '712'), $('#video3').attr('height', '400') }) } } function Ysearch(e) { var t = $(e), n = encodeURIComponent(t.prev().val()); var o = "/Index/Search/search?selc=all&key=" + n; $("#linkUrl").attr("href", o).get(0).click(); $("#forward").click() } function Ysearchs(e) { var t = $(e), n = encodeURIComponent(t.val()); var o = "/Index/Search/search?selc=all&key=" + n; $("#linkUrl").attr("href", o).get(0).click(); $("#forward").click() } function huxi(huxishijian, jiangeshijian) { var nowimg = 0, timer = setInterval(rightButFunc, jiangeshijian); $(".lunbo").mouseenter(function() { var lunbo_id = $(this).attr("id"); if(lunbo_id!='lunbo_i'){$('.lunbo .leftBut,.lunbo .rightBut').show();clearInterval(timer);}; }); $(".lunbo").mouseleave(function() { $('.lunbo .leftBut,.lunbo .rightBut').hide(); clearInterval(timer); timer = setInterval(rightButFunc, jiangeshijian) }); $(".lunbo .rightBut").click(rightButFunc); function rightButFunc() { if (!$(".lunbo>ul>li").is(":animated")) { if (nowimg < $(".lunbo>ul>li").length - 1) { nowimg++ } else { nowimg = 0 } changePicFunc() } } $(".lunbo .leftBut").click(function() { if (!$(".lunbo>ul>li").is(":animated")) { if (nowimg > 0) { nowimg-- } else { nowimg = $(".lunbo>ul>li").length - 1 } changePicFunc() } }); $(".lunbo>ol>li").click(function() { if (!$(".lunbo>ul>li").is(":animated")) { nowimg = $(this).index(); changePicFunc() } }); function changePicFunc() { $(".lunbo>ul>li").eq(nowimg).fadeIn(huxishijian).siblings().fadeOut(huxishijian); $(".lunbo>ol>li").eq(nowimg).addClass("current").siblings().removeClass("current") } }