阅读更多
原生态javascript,希望大家能喜欢
function Gametimeline(){var c=document,a=arguments.callee,b=this;b.parent=c.getElementById("GameModuleTimeline"),b.hand=c.getElementById("GametimelineHandler"),b.handler=b.hand.getElementsByTagName("b"),b.date=b.hand.getElementsByTagName("span"),b.container=c.getElementById("GameModuleTimelineContainer"),b.pointer=c.getElementById("GametimelinePointer");!a.cache&&(a.cache=[[],[],[]]);if(b.container.children.length!==b.handler.length){return false}!this.parseDate&&(a.prototype.parseDate=function(){var g=0,d=b.handler.length,e=[];for(;gd.right){a.cache[1][g]="visibility:visible;left:"+(d.right-k.offsetWidth-d.left)+"px;"}else{a.cache[1][g]="visibility:visible;left:"+(i.left-k.offsetWidth/2-d.left)+"px;"}}}!a.cache[2][g]&&(a.cache[2][g]=("visibility:visible;left:"+(parseInt(this.style.left)-b.pointer.offsetWidth/2+this.offsetWidth/2)+"px; z-index:60;"));b.off.call(this,g);this.className="GametimelineOn";h.style.cssText=a.cache[0][g];b.fx(h,"top",15,80);!window.ActiveXObject&&(b.fadeIn.call(h,50),b.fadeIn.call(k,50));k.style.cssText=a.cache[1][g];b.pointer.style.cssText=a.cache[2][g]};a.prototype.off=function(e){var f=0,d=b.handler.length;for(;f1:j<0)&&(j=i?1:0),k===true?e.style.filter="alpha(opacity="+j*100+")":e.style.opacity=j;(i?j<1:j>0)&&setTimeout(function(){f.call(e,d,j,i,g)},1000/d);(i?j===1:j===0&&"undefined"!==typeof g)&&("function"===typeof g&&g.call(e))};a.prototype.addEvent=function(h,g,f,e){var d=arguments.callee;h.attachEvent&&(d=function(k,j,i){k.attachEvent("on"+j,i)}).apply(this,arguments);h.addEventListener&&(d=function(k,j,i){k.addEventListener(j,i,e||false)}).apply(this,arguments);h["on"+g]&&(d=function(k,j,i){k["on"+j]=function(){i()}}).apply(this,arguments)};a.prototype.trigger=function(f,e){var d,g=document;undefined!==g.createEvent?(d=g.createEvent("MouseEvents"),d.initMouseEvent(e,true,true,document.defaultView,0,0,0,0,0,false,false,false,false,0,null),f.dispatchEvent(d)):(d=g.createEventObject(),d.screenX=100,d.screenY=0,d.clientX=0,d.clientY=0,d.ctrlKey=false,d.altKey=false,d.shiftKey=false,d.button=false,f.fireEvent("on"+e,d))};return{init:function(d){b.parseDate();b.locateHandler();b.trigger(b.handler[d],"mouseover")}}};
new Gametimeline().init(0);
- timelime.rar (5.8 KB)
- 下载次数: 26