//bublic header_footer //$(function () { // $(document).ready(function () { // $(".header").load("header.html"); // $(".footer").load("footer.html"); // }); //}); //导航滑块 function setslip() { var slip = $('.nav').find(".slidline"); var a = $('.nav li.curr'); //初始化滑块 slip.css({ 'width': a.width() + 6, 'left': parseint(a.position().left) + 14 + 'px', }); $('.nav li').mouseenter(function () { //移动滑块 slip.stop().animate({ width: $(this).width() + 6, left: parseint($(this).position().left) + 14 + 'px', }, 300); }); $('.nav').mouseleave(function () { //移动滑块 slip.stop().animate({ width: a.width() + 6, left: parseint(a.position().left) + 14 + 'px', }, 600); }); }; // 导航栏定位 function shownav() { var urlstr = location.href; var urlstatus = false; var type = 0; if (urlstr.indexof("company") != -1) { type = 0; } else if (urlstr.indexof("scheme") != -1 || urlstr.indexof("core") != -1) { type = 1; } else if (urlstr.indexof("product") != -1) { type = 2; } else if (urlstr.indexof("ability") != -1) { type = 3; }else if (urlstr.indexof("profession") != -1) { type = 6; } else if (urlstr.indexof("contact") != -1) { type = 7; } else if (urlstr.indexof("d") != -1) { type = 5; } $(".nav").find("li").eq(type).addclass('curr'); } function setslip2() { var slip = $('.tit_snav').find(".slidline"); var a = $('.tit_snav li.curr'); //初始化滑块 slip.css({ 'width': a.width() + 10, 'left': parseint(a.position().left) + 17 + 'px', }); $('.tit_snav li').mouseenter(function () { //移动滑块 slip.stop().animate({ width: $(this).width() + 10, left: parseint($(this).position().left) + 17 + 'px', }, 300); }); $('.tit_snav').mouseleave(function () { //移动滑块 slip.stop().animate({ width: a.width() + 10, left: parseint(a.position().left) + 17 + 'px', }, 600); }); }; //阻止节点触发事件 function cancelbubble(e) { if (e.stoppropagation) { e.stoppropagation(); } else if (window.event) { window.event.cancelbubble = true; } }