//$("a['href'='team.html']").hide()
//$("a['href'='about/team.html']").hide()
//$("a['href'='chairman.html']").hide()
//$("a['href'='about/chairman.html']").hide()
$(function () {
//侧边栏工具显示隐藏
$(window).scroll(function () {
var scrollT = $(this).scrollTop();
if (scrollT > 300) {
$(".back").show();
}
else {
$(".back").hide();
}
});
//回到顶部
$(".goTop").click(function () {
$("html,body").animate({ scrollTop: 0 }, function () {
$(".back").hide();
});
});
//侧边栏鼠标经过弹出效果
$(".back li").blur(function (e) {
e.stopPropagation();
})
$(".back li").mouseenter(function () {
$(this).children(".back-content").stop().fadeIn();
})
$(".back li").mouseleave(function () {
$(this).children(".back-content").stop().fadeOut();
})
$(".back-content textarea").mouseleave(function (e) {
e.stopPropagation();
})
//菜单功能实现
tabActive();
//内页导航
var tabHover = false;
$(".tab-inner li").hover(function () {
tabHover = false;
if ($(this).hasClass("active")) {
tabHover = true;
} else {
$(this).addClass("active");
}
}, function () {
if (!tabHover) {
$(this).removeClass("active");
}
});
var aboutTabHover = false;
$(".about-tab li").hover(function () {
aboutTabHover = false;
if ($(this).hasClass("active")) {
aboutTabHover = true;
} else {
$(this).addClass("active");
}
}, function () {
if (!aboutTabHover) {
$(this).removeClass("active");
}
});
//sub-title动画
$(window).scroll(function () {
var scrollT = $(this).scrollTop();
$(".sub-title").each(function () {
var $this = $(this);
createAnimate($this, scrollT, "fadeInUp");
});
});
});
function createAnimate(obj, scrollT, animateName) {
var windowH = $(window).height();
var deltaHeight = windowH + scrollT;
var topNum = $(obj).offset().top;
var delay = $(obj).attr("data-delay");
if (topNum < windowH) {
return
}
if ((topNum + 20) <= deltaHeight) {
if (delay) {
$(obj).css({
"-webkit-animation-delay": delay,
"-moz-animation-delay": delay,
"animation-delay": delay
})
}
$(obj).addClass(animateName);
}
}
var m1;
function tabActive() {
//nav内二级菜单显示隐藏
// $(".nav li").hover(function () {
// clearInterval(m1);
// var index = $(this).index();
// $(this).addClass("hover").siblings().removeClass("hover");
// $(".menus .menu-box").stop().hide();
// var menuBoxIndex;
// if (index !== 0) {
// menuBoxIndex = index - 1;
// $(".menus .menu-box").eq(menuBoxIndex).stop().fadeIn(200);
// }
// }, function () {
// clearInterval(m1);
// m1 = setInterval(function () {
// $(".menus .menu-box:visible").stop().hide();
// }, 20);
// $(this).removeClass("hover");
// });
// $(".menus .menu-box").hover(function () {
// clearInterval(m1);
// }, function () {
// clearInterval(m1);
// m1 = setInterval(function () {
// $(".menus .menu-box:visible").stop().hide();
// }, 20);
// });
$('.nav li').mouseenter(function () {
var num = $(this).index();
if (num == 0) {
$('.menus').stop().hide();
$('.nav li').removeClass('hover')
$(this).addClass('hover');
return false;
}
$('.menus').stop().show();
$('.menus .menu-box').hide();
$('.menus .menu-box').eq(num - 1).show();
$('.nav li').removeClass('hover')
$(this).addClass('hover');
}).mouseleave(function () {
});
$('.menus').mouseleave(function () {
$('.menus').stop().hide();
$('.nav li').removeClass('hover');
});
$('.header-inner').mouseenter(function () {
$('.menus').stop().hide();
$('.nav li').removeClass('hover');
});
$('.nav li:first').mouseleave(function () {
$(this).removeClass('hover');
})
//二级菜单hover
$(".menu-item dd>a").each(function () {
var num = $(this).text().length;
$(this).next(".hline").width(16 * num)
});
$(".hline-1").width(($(".child").text().length - 1) * 16);
//微信处理
$(".wx").on("mouseenter", function () {
$(".weixin").show();
$(this).find(".icon").attr("src", function (i, attr) {
return attr.replace(".png", "-on.png");
})
});
$(".wx").mouseleave(function () {
$(".weixin").hide();
$(this).find(".icon").attr("src", function (i, attr) {
return attr.replace("-on.png", ".png");
})
})
}
var currentYear = new Date().getFullYear();
var text = '\n\t\t\tCopyright © ' + currentYear + ' 6165cc金沙总站检测中心 All Rights Reserved\n 工商网监 豫ICP备05010375号\n \x3Cscript type="text/javascript" src="//js.users.51.la/21839671.js">\x3C/script>51La51La\n 营业执照\n '
$(".footer").find("p").html(text)
// $(function () {
// $('.xt_menu ul li').mouseenter(function () {
// var num = $('.xt_menu ul li').index(this);
// if (num == 0) {
// $('.menu_bg').stop().hide();
// $('.xt_menu ul li').find('.menu_item').removeClass('menu_item_active')
// $(this).find('.menu_item').addClass('menu_item_active');
// return false;
// }
// $('.menu_bg').stop().show();
// $('.menu_bg .menu-box').hide();
// $('.menu_bg .menu-box').eq(num - 1).show();
// $('.xt_menu ul li').find('.menu_item').removeClass('menu_item_active')
// $(this).find('.menu_item').addClass('menu_item_active');
// }).mouseleave(function () {
// });
// $('.menu_bg').mouseleave(function () {
// $('.menu_bg').stop().hide();
// $('.xt_menu ul li').find('.menu_item').removeClass('menu_item_active');
// });
// $('.header').mouseenter(function () {
// $('.menu_bg').stop().hide();
// $('.xt_menu ul li').find('.menu_item').removeClass('menu_item_active');
// });
// $('.xt_menu ul li:first').mouseleave(function () {
// $(this).removeClass('menu_item_active');
// })
// });