//导航效果(兼容ie6) $(document).ready(function() { $(".nav ul li:has(div.xx)").hover(function() { $(this).children("div.xx").stop(true, true).slidedown(400) }, function() { $(this).children("div.xx").stop(true, true).slideup("fast") }) $(".nav_fa ul li:has(div)").hover(function() { $(this).children("div").stop(true, true).slidedown(400) }, function() { $(this).children("div").stop(true, true).slideup("fast") }) }); //全局动画 wow = new wow( { animateclass: 'animated', offset:50, } ); wow.init(); //首页方案 $('.h-fangan ul li').hover( function() { $(this).addclass('fa') }, function() { $(this).removeclass('fa') } ); $('.n-youshi ul li').hover( function() { $(this).addclass('fa') }, function() { $(this).removeclass('fa') } ); $('.h-show ul li').hover( function(){ $(this).addclass('li1').siblings().removeclass('li1'); //添加classname删除兄弟元素classname } ); $('.h-show2 ul li').hover( function(){ $(this).addclass('li1').siblings().removeclass('li1'); //添加classname删除兄弟元素classname } ); $('.n-fangan dl').hover( function(){ $(this).addclass('on'); }, function(){ $(this).removeclass('on'); } ); // javascript document /* function numaddanim(id) { var $obj = $("#" + id); var this_text = $("#" + id).text(); $("#" + id).text('0') var ext = ''; if(this_text.substr(this_text.length-1,1) == '+'){ext = '+';} var range = $obj.data("to") - $obj.data("from"); var speed = $obj.data("speed") / range; if (speed < 25) { speed = 25; } var timer = setinterval(function () { var num = parseint($obj.html()); if (num < $obj.data("to")) { $obj.html(num + math.max(1, parseint(range / 40))); } else { $obj.html($obj.data("to") + ext); clearinterval(timer); } }, speed); } var sw = true; */ /*--导航--*/ $(function(){ $(window).on("scroll",function(){ var scrollhgt = $(this).scrolltop(); var headeroft = $(".header").height(); /* 头部滚动定位效果 */ if(scrollhgt > headeroft){ $(".header").addclass("tbg"); }else { $(".header").removeclass("tbg"); }; /* var scrollvalue = $(window).scrolltop(); if (sw && scrollvalue > $(".youshi").offset().top + 400 - $(window).height()) { sw = false; numaddanim('num1'); numaddanim('num2'); numaddanim('num3'); numaddanim('num4'); numaddanim('num5'); }; */ }); });