河南中医药大学第一附属医院 - 河南省中医管理局

特色服务

: * 传入节点及一个类名,检查该节点是否含有传入的类名 */ var names = node.className.split(/\s+/); for(var i=0, len=names.length; i= this.btns.length) { this.pointer = 0; } this.clearHover(); this.btns[this.pointer].className = this.hoverClass; //this.scrollContent.style.top = parseInt(-this.imgHeight * this.pointer) + 'px'; var startVal = parseInt(this.scrollContent.style.left) || 0; var alterVal = (parseInt(-startVal - this.imgHeight * this.pointer)); this.animateIterval && this.animateIterval();//修正快速切换时闪动 this.animateIterval=animate(this.scrollContent, {left : startVal},{left : alterVal}, 1000, Tween.Quad.easeOut); //这里默认设置每张图滚动的总时间是1s }, next: function() { this.invoke(this.pointer + 1); }, last: function(){ if(this.pointer<1){ this.invoke(4); }else{ this.invoke(this.pointer - 1); } }, clearHover: function() { for(var i=0; i=dur) clearInterval(t); for (var i in start) { o.style[i]=fx(start[i],alter[i],curTime,dur)+"px"; } curTime+=40; },40); return function () { clearInterval(t); }; } var Tween = { /* * 功能说明: * 加速运动 * curTime:当前时间,即动画已经进行了多长时间,开始时间为0 * start:开始值 * alter:总的变化量 * dur:动画持续多长时间 */ Linear:function (start,alter,curTime,dur) {return start+curTime/dur*alter;},//最简单的线性变化,即匀速运动 Quad:{//二次方缓动 easeIn:function (start,alter,curTime,dur) { return start+Math.pow(curTime/dur,2)*alter; }, easeOut:function (start,alter,curTime,dur) { var progress =curTime/dur; return start-(Math.pow(progress,2)-2*progress)*alter; }, easeInOut:function (start,alter,curTime,dur) { var progress =curTime/dur*2; return (progress<1?Math.pow(progress,2):-((--progress)*(progress-2) - 1))*alter/2+start; } } }; function changebg(Obj){ Obj.style.background="#890100"; Obj.getElementsByTagName("a")[0].style.color="#f6ff00"; } function bgreturn(Obj){ Obj.style.background="#ae0100"; Obj.getElementsByTagName("a")[0].style.color="#faf4ed"; } $(document).ready(function(){ $('li.mainlevel').mousemove(function(){ $(this).find('ul').slideDown("1000");//you can give it a speed }); $('li.mainlevel').mouseleave(function(){ $(this).find('ul').slideUp("fast"); }); });