$(function(){ //二级导航 if ($(window).width() > 800) { $(".header_ablock").hover(function () { $(this).find(".nav_content").stop(true, true).fadein(); }, function () { $(".nav_content").stop(true, true).fadeout(); }) } else { $(".header_ablock").on("click", function () { $(this).find(".nav_content").stop(true, true).slidetoggle(); $(this).siblings().find(".nav_content").stop(true, true).slideup(); $(this).toggleclass("current").siblings().removeclass("current"); }) } //全屏自适应 var wheight = $(window).height(); function resize(){ wheight = $(window).height(); if(!$("body").hasclass("index_bodyer")){ $(".common_content").css({minheight:wheight-236}); } } resize(); $(window).resize(function(){ resize(); }); var href = location.href; if (href.indexof("/aboutus/") > -1) { $(".header_ablock").eq(1).addclass("current"); } else if (href.indexof("/party/") > -1) { $(".header_ablock").eq(3).addclass("current"); } else if (href.indexof("/business/") > -1) { $(".header_ablock").eq(2).addclass("current"); } else if (href.indexof("/news/") > -1) { $(".header_ablock").eq(4).addclass("current"); } else if (href.indexof("/client/") > -1) { $(".header_ablock").eq(5).addclass("current"); } else if (href.indexof("/contactus/") > -1) { $(".header_ablock").eq(6).addclass("current"); } else { $(".header_ablock").eq(0).addclass("current"); } if (href.indexof("/course") > -1 || href.indexof("/activity") > -1 || href.indexof("/recruitment") > -1 || href.indexof("/news/2") > -1 ) { $(".navco_ablock").eq(1).addclass("cur"); } else if (href.indexof("/organization") > -1 || href.indexof("/feedback") > -1 || href.indexof("/news/3") > -1 ) { $(".navco_ablock").eq(2).addclass("cur"); } else if (href.indexof("/culture") > -1 ) { $(".navco_ablock").eq(3).addclass("cur"); } else if (href.indexof("/features") > -1 ) { $(".navco_ablock").eq(4).addclass("cur"); } else if (href.indexof("/honor") > -1 || href.indexof("/certificate") > -1 || href.indexof("/position") > -1 ) { $(".navco_ablock").eq(5).addclass("cur"); } else if (href.indexof("/video") > -1 ) { $(".navco_ablock").eq(6).addclass("cur"); } else { $(".navco_ablock").eq(0).addclass("cur"); } var pa = (parseint(href.split("list/")[1]) - 1) || 0; if (parseint(href.split("?pa=")[1])) { pa = parseint(href.split("?pa=")[1]) } if (pa > 0) { $(".navco_ablock").eq(pa).addclass("cur").siblings().removeclass("cur"); } $(".this_span").html($(".navco_ablock.cur").text()); $(".abo_ch").html($(".navco_ablock.cur").text()); $(".abo_en").html($(".navco_ablock.cur").attr("ten")); //视频 $(".vid_button").on("click", function () { var src = $(this).attr("da-src"); if (src != "" && src != undefined) { $(".vidbl_content").stop(true, true).fadein(); $(".videobl_conblock").html(videohtml(src, "100%", "auto")); var topv = ($(window).height() - $(".videobl_conblock video").height()) / 2 - 50; $(".videobl_conblock video,.videobl_clear").css({ "top": topv }) document.getelementbyid("example_video_1").play(); } }) $(".vidbl_bg,.videobl_clear").on("click", function () { $(".vidbl_content").stop(true, true).fadeout(); $(".videobl_conblock").html(""); }) $(".vidbl_content").bind('mousewheel', function (event, delta) { event.stoppropagation() return true; // 返回值在这 }); $(window).resize(function () { var topv = ($(window).height() - $(".videobl_conblock video").height()) / 2; $(".videobl_conblock video,.videobl_clear").css({ "top": topv }) }) function hidenav() { $(".ind6_nav").removeclass("cur"); $(".header_ulcontent").css({ right: -220 }) $(".ind6_bgcol").stop(true, true).fadeout(); } $(".ind6_nav").on("click", function () { if ($(".ind6_nav").hasclass("cur")) { hidenav(); } else { $(".ind6_nav").addclass("cur"); $(".header_ulcontent").css({ right: 0 }) $(".ind6_bgcol").stop(true, true).fadein(); } }) $(".ind6_bgcol").on("click", function () { hidenav(); }) $(".after").on("click", function () { $(".nav_ul").stop(true, true).slideup(300); $(this).siblings(".nav_ul").stop(true, true).slidedown(300); }) /* 前端自适应双图处理,类名绑定(img_node绑图,bg_node绑背景),w-src(对应pc),t-src(对应微站) */ $(".img_node").each(function () { var _this = $(this); if ($(window).width() > 768) { _this.attr("src", $(this).attr("w-src")); } else { var src = $(this).attr("t-src") || $(this).attr("w-src"); _this.attr("src", src); } }) $(".bg_node").each(function () { var _this = $(this); if ($(window).width() > 768) { _this.css("background-image", "url(" + $(this).attr("w-src") + ")"); } else { var src = $(this).attr("t-src") || $(this).attr("w-src"); _this.css("background-image", "url(" + src + ")"); } }) })