$(function () { //低版本ie判断 if (client.browser.ie > 5 && client.browser.ie < 9) { $(".alert_block").css({"display":"block"}) } //导航 var href = location.href; var leva = 0; var on = 0; var aboutus = new regexp("/group"); var business = new regexp("/business"); var yuanjing = new regexp("/vision"); var dangjian = new regexp("/party"); var news = new regexp("/news"); var contact = new regexp("/contact") console.log(aboutus.test(href)) if (aboutus.test(href)) { on = 1; } else if (business.test(href)) { on = 2; $("html,body").stop().animate({ scrolltop: 0 }) } else if (yuanjing.test(href)) { on = 3; } else if (dangjian.test(href)) { on = 4; } else if (news.test(href)) { on = 5; }else if( contact.test(href)){ on = 6; } console.log(on) var wheight = $(window).height(); var wwidth = $(window).width(); function resize() { wheight = $(window).height(); wwidth = $(window).width(); } resize(); $(window).resize(function () { resize(); }); var wid = $(".nav > .navitem").eq(on).width(); var le = $(".nav > .navitem").eq(on).position().left; $(".nav_bgbl").css({ "width": wid, "left": le }); $(".nav_ulbl .navitem").on("mouseover", function () { var bwid = $(this).width(); var leva = $(this).position().left; $(".nav_bgbl").css({ "width": bwid, "left": leva }); }) $(".nav_ulbl").on("mouseleave", function () { $(".nav_bgbl").css({ "width": wid, "left": le }); }) var scrto = 0; var href = location.href; var inner = new regexp("inner.html"); if (!inner.test(href)) { $(window).scroll(function () { scrto = $("#header").offset().top; if (scrto < 500) { $(".in_bg2").css({ "top": -scrto / 2 }) $(".in_ti").css({ "margintop": scrto / 2 }) } if (scrto > 450) { $(".in_bg2").css({ "display": "none" }) } else { $(".in_bg2").css({ "display": "block" }) } }) } //标题宽度 var tiwid = $(".inbl_ti span").width() + 60; $(".inbl_ti").css({ "width": tiwid }); //视频 $(".vid_button").on("click", function () { $(".vidbl_content").stop(true, true).fadein(); var src = $(this).attr("da-src"); $(".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(); }) //手机站视频处理 if (wwidth < 800) { $(".ind02_img").html(""); $(".ind02_bl,.indpl_bl").on("click", function () { $(".vidbl_content").stop(true, true).fadein(); var src = $(this).attr("da-src"); $(".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 }) }) settimeout(function () { $(".ddgdata").each(function () { $(this).attr("style", $(this).attr("data")); }); }, 500) $("img").each(function () { $(this).attr("src", $(this).attr("data-src")); }); $(".img_node").each(function () { var _this = $(this); if (wwidth > 800) { _this.attr("src", $(this).attr("w-src")); } else { _this.attr("src", $(this).attr("t-src")); } }) $(".bg_node").each(function () { var _this = $(this); if (wwidth > 800) { _this.css("background-image", "url(" + $(this).attr("w-src") + ")"); } else { _this.css("background-image", "url(" + $(this).attr("t-src") + ")"); } }) }) //请求连接参数分割 $urlparameter = function (_key) { //debugger var _url = window.location.search; //如果不等于空表示存在参数 if (_url.length != 0) { //清除问号字符 _params = _url.replace('?', "").split('&'); for (var i = 0; _p = _params[i]; i++) { _params[_p.split('=')[0]] = _p.split('=')[1]; } //是否返回固定参数值 if (_key && _key.length != 0) { return _params[_key]; } //否则返回对象集合 return _params; } }