$(function () { $('.nav li.nLii').hover(function () { $('.headBg').addClass('into') }, function () { $('.headBg').removeClass('into') }) }); // 手机版导航弹出效果 $(function(){ $('.phone_btn a').click(function(){ $('.menu_box').addClass('into') }) $('.menu_close').click(function(){ $('.menu_box').removeClass('into') }) }) // 手机版导航展开效果 $(function(){ // nav收缩展开 $('.navMenu li a').on('click',function(){ var parent = $(this).parent().parent();//获取当前页签的父级的父级 var labeul =$(this).parent("li").find(">ul") if ($(this).parent().hasClass('open') == false) { //展开未展开 parent.find('ul').slideUp(300); parent.find("li").removeClass("open") parent.find('li a').removeClass("active").find(".arrow").removeClass("open") $(this).parent("li").addClass("open").find(labeul).slideDown(300); $(this).addClass("active").find(".arrow").addClass("open") }else{ $(this).parent("li").removeClass("open").find(labeul).slideUp(300); if($(this).parent().find("ul").length>0){ $(this).removeClass("active").find(".arrow").removeClass("open") }else{ $(this).addClass("active") } } }); }); // banner锚点缓动跳转 $(function () { var b = (window.opera) ? (document.compatMode === 'CSS1Compat' ? $('html') : $('body')) : $('html,body') $('.banner_dw').click(function () { top('#banner_dw') }) function top(a) { b.animate({ scrollTop: $(a).offset().top - 20 }, 600) return false } }) $(function () { jQuery(".nav").slide({ type:"menu",// 效果类型,针对菜单/导航而引入的参数(默认slide) titCell:".nLi", //鼠标触发对象 targetCell:".sub", //titCell里面包含的要显示/消失的对象 effect:"slideDown", //targetCell下拉效果 delayTime:150 , //效果时间 triggerTime:100, //鼠标延迟触发时间(默认150) defaultIndex:10, returnDefault:true //鼠标移走后返回默认状态,例如默认频道是“预告片”,鼠标移走后会返回“预告片”(默认false) }); }) // 头部浮动 $(function () { //超过一定高度导航添加类名 var nav = $("header"); //得到导航对象 var win = $(window); //得到窗口对象 var sc = $(document); //得到document文档对象。 win.scroll(function () { if (sc.scrollTop() >= 300) { nav.addClass("scope"); } else { nav.removeClass("scope"); } }); }) //波浪动画 $(function() { var marqueeScroll = function(id1, id2, id3, timer) { var $parent = $("#" + id1); var $goal = $("#" + id2); var $closegoal = $("#" + id3); $closegoal.html($goal.html()); function Marquee() { if (parseInt($parent.scrollLeft()) - $closegoal.width() >= 0) { $parent.scrollLeft(parseInt($parent.scrollLeft()) - $goal.width()); } else { $parent.scrollLeft($parent.scrollLeft() + 1); } } setInterval(Marquee, timer); } var marqueeScroll1 = new marqueeScroll("marquee-box", "wave-list-box1", "wave-list-box2", 8); var marqueeScroll2 = new marqueeScroll("marquee-box3", "wave-list-box4", "wave-list-box5", 10); });