$(window).scroll(function() { if($(document).scrolltop() <= 134){ $(".header").removeclass("header-hover"); }else { $(".header").addclass("header-hover"); } }) $(document).ready(function() { settimeout(function () { endloader(); }, 500); //当前页面导航 var bodyid = $('body').attr('id'); //当前页 if (bodyid) { var re = /[a-za-z]/g; var id = parseint(bodyid.replace(re, '')); $('#nav ul').children('li').eq(id).addclass("active"); if (id > 0) { $(".header").addclass("header-active"); } } $(".header").hover(function() { $(".header").addclass("header-hover"); },function() { if($(document).scrolltop() <= 134){ $(".header").removeclass("header-hover"); }else { $(".header").addclass("header-hover"); } }) $(".navbar-nav > li.hasdrop").hover(function() { $(this).children("div.hasdrop-hover").stop().slidedown(); },function() { $(this).children("div.hasdrop-hover").stop().slideup(); }) $(".hasdrop-hover .cont .hovmenu .li").mouseover(function(){ var _index = $(this).index(); $(this).addclass("active").siblings().removeclass("active"); $(this).parents().next().find(".item").eq(_index).show().siblings().hide(); }) // $(".hasdrop-hover .submenu").each(function() { // var len = $(this).children(".items").length; // $(this).children(".items").css("width", math.floor(100 / len) + "%"); // }) $(".navbar-nav li.dropdown").hover(function() { $(this).children(".dropdown-menu").stop().slidedown(); },function() { $(this).children(".dropdown-menu").stop().slideup(); }) $(".search-btn").click(function(e) { $(this).parent(".search-box").toggleclass("open"); $(document).on("click", function(e) { if($(".search-box").is(".open")) { $(".search-box").removeclass("open") } }) e.stoppropagation(); }) $(".search-box form").click(function(e) { e.stoppropagation(); }) $(".indexabout .video").hover(function() { $(".indexabout .tipbox").stop().slidedown(); },function() { $(".indexabout .tipbox").stop().slideup(); }) $(".scene-tab li").hover(function() { var _index = $(this).index(); $(this).addclass("active").siblings().removeclass("active"); $(".scene-tab-container > div").eq(_index).addclass("is-active").siblings().removeclass("is-active"); }) $(".scene-tab li").eq(0).addclass("active"); $(".scene-tab-container > div").eq(0).addclass("is-active"); $(".news-header-right .tab-tag a").hover(function() { var _index = $(this).index(); var res = $(this).attr("href"); $(".news-header-right .more").attr("href", res) $(this).addclass("on").siblings().removeclass("on"); $(".new-content > div").eq(_index).fadein().siblings().fadeout(); }) //返回顶部 $(".returntop").click(function() { $('body,html').animate({ scrolltop: 0 }, 500); return false; }) $(".customized-product-list .section-box li").hover(function() { $(this).find(".titbox").stop(true,true).animate({height:"100%"},400); },function() { $(this).find(".titbox").stop(true,true).animate({height:"92px"},400); }) //弹出视频播放 $(".tipbox > div").click(function() { var img = $(this).attr("vpath"); var video = $(this).attr("ipath"); $(".videos").html(""); $(".mask").show(); }) $(".videolist li").each(function() { $(this).click(function() { var img = $(this).attr("vpath"); var video = $(this).attr("ipath"); $(".videos").html(""); $(".mask").show(); }) }) }) function endloader() { $("#loader").addclass("hide") } function close1(){ var v = document.getelementbyid("video");//获取视频节点 $(".mask").hide();//点击关闭按钮关闭暂停视频 v.pause(); $(".videos").html(""); }