- 浏览: 24100 次
- 性别:
- 来自: 北京
最新评论
-
梧栖凤:
得把未经处理的脚本分享出来啊!
跨浏览器可8方向拖拽剪裁框 -
percy30856:
好东西 正在弄这个玩意儿 参考学习了
Animate Baseclass -
percy30856:
菲哥 你的头像,应该换成未满18岁禁止查看
很棒的时间线控件 -
stoneskin:
:哭笑写javascript的也是猿。。。。我们很多猿都是从写 ...
核心只要两行即可实现添加或移除className -
jamesmos:
enix2212 写道tiannet 写道enix2212 写 ...
核心只要两行即可实现添加或移除className
原生态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(;g<d;){var h=b.handler[g],f=new Function("return"+("["+b.date[g].innerHTML.replace(/\./gi,",")+"]"))();b[g]=+new Date(f[0],f[1],f[2]);b.length=g;h.style.left="";void function(i,k){b.addEvent(k,"mouseover",function(){b.activity.call(k,i)},false)}(g++,h)}return b});a.prototype.locateHandler=function(){var f=(b[b.length]-b[0])/86400000,g=0,d=b.handler.length,e=0;for(;g<d;){e=((b[g]-b[0])/(f*86400000))*b.parent.offsetWidth;b.fx(b.handler[g],"left",((g===d-1||g===0)?e-20:e),50);g++}};a.prototype.Linear=function(f,e,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+e}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+e}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+e}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+e}}}};a.prototype.fx=function(e,p,m,l){var n=0,m=m||50,l=l||100,q=0,f=0,g=10,h=0;void function(){e.style[p]=Math.ceil(b.Linear(q,n,m,l))+"px";if(parseInt(e.style[p])<m){q++;setTimeout(arguments.callee,10)}}()};a.prototype.activity=function(g){var j=Array.prototype.slice,f=b.date,h=f[g],e=b.container,k=e.children[g],i=b.getClinetRect(this),d=b.getClinetRect(b.container);!a.cache[0][g]&&(a.cache[0][g]="visibility:visible;left:"+(parseInt(this.style.left)-f[0].offsetWidth/2+this.offsetWidth/2+"px"));if(!a.cache[1][g]){if((i.left-k.offsetWidth/2)<d.left){a.cache[1][g]="visibility:visible;left:0px;"}else{if((i.left+k.offsetWidth/2)>d.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(;f<d;){if(f!==e){b.date[f].style.visibility="hidden",b.container.children[f].style.visibility="hidden";b.handler[f].className="GametimelineOff"}f++}};a.prototype.getClinetRect=function(f){var d=f.getBoundingClientRect(),e=(e={left:d.left,right:d.right,top:d.top,bottom:d.bottom,height:(d.height?d.height:(d.bottom-d.top)),width:(d.width?d.width:(d.right-d.left))});return e};a.prototype.fadeIn=function(d,e){b.doFade.call(this,d/10,0,true,e)};a.prototype.doFade=function(d,j,i,g){var k=undefined!==window.ActiveXObject,f=arguments.callee,e=this,h;j+=(i?1:-1)/d,(i?j>1: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
发表评论
-
[javascript]9宫格拖拽拼图游戏 puzzle
2012-04-29 09:51 15691.跨浏览器,主流浏览器都可以运行2.纯javascript开 ... -
避免悲剧 密码生成器
2011-12-22 15:35 742最近被暴库的很多,密码安全成为重大问题!如何避免简单密码呢?还 ... -
jQuery创建实例与原型继承揭秘
2011-12-20 23:57 762在普通情况下 ... -
[Javascript]单例模式(singleton )
2011-12-16 15:23 1314Javascript中大家都很习惯用new运算符创建实例。现在 ... -
javascript1.7新语法
2011-12-13 18:30 8701.yield 关键字 Yield的作用与return 差不多 ... -
javascript undo redo
2011-12-09 10:55 2375在浏览器中用调试工具看调用结果 <!DOCTYPE ... -
duffsDevice 高速版
2011-11-25 17:21 788function duffsDevice(items, f ... -
ECMAScript.js2
2011-11-07 11:18 1326package { public native functio ... -
仅限正整数输入
2011-10-27 15:35 865修正了拖拽文本进输入框问题 2011.11.14 &l ... -
Another JavaScript quiz
2011-08-19 18:34 640测试题来自《Another JavaScript quiz》P ... -
跨浏览器可8方向拖拽剪裁框
2011-08-15 20:01 871<!DOCTYPE html PUBLIC &quo ... -
选项卡
2011-08-12 17:36 891<!DOCTYPE html PUBLIC &quo ... -
scroll base
2011-08-04 14:25 886开发版,水平方向已完成,垂直方向没测,可以跨浏览,滚动多个当前 ... -
拖拽排序列表单例
2011-07-27 11:17 1169<!DOCTYPE html PUBLIC &quo ... -
Animate Baseclass
2011-07-12 15:47 1184以下代码仅供参考,请下载附件代码,应该是文本编辑器过滤掉了某些 ... -
fade方法
2011-05-27 10:12 771function fadeOut(steps){ ... -
核心只要两行即可实现添加或移除className
2011-04-29 11:10 1748<div id="abc" cl ... -
让函数有记忆能力
2011-04-28 15:34 683function addEvent(elem,evType ... -
可以跳动的手风琴 Accordion
2011-04-13 15:02 764<!DOCTYPE html PUBLIC &q ... -
javascript new 关键字的运行原理
2011-04-06 17:33 1537function javascriptNew(t){ a= ...
相关推荐
wpf 时间轴控件
TimelineDataSource时间线控件 TimelineDataSource时间线控件 TimelineDataSource时间线控件 TimelineDataSource时间线控件 TimelineDataSource时间线控件 TimelineDataSource时间线控件
音视频播放器时间轴控件。
通过MFC的静态类派生的时间轴控件,提供时间轴的显示、设置及查询,并且可在时间轴上显示两层不同颜色的背景,供有类似需求的MFC程序员参考。
QT 时间轴控件 可拖动!!!!!!!!!!!!!!!!
时间轴控件控件,里面有样式和js从上到下排列按时间顺序
C# 自定义控件实现时间轴,C# 自定义控件实现时间轴,C# 自定义控件实现时间轴,C# 自定义控件实现时间轴,C# 自定义控件实现时间轴
jquery时间轴控件,内含时间轴JS类库,开发实例,轻巧好用
Andorid自定义布局时间轴控件
一个自定义时间轴控件,有问题可以留言
easyUI,时间控件,解决时间格式化问题
WPF时间轴 在Flash动画的制作中,有一个时间轴的概念。时间轴是用来控制在动画运行中相应的时间时,某个或某些对象所需要执行的操作。
DYLIKE时间轴控件
时间轴控件,标有时间刻度,可根据时间在控件上画label,支持放大缩小操作
时间轴控件控件,里面有样式和js从上到下排列按时间顺序
基于MFC写的时间轴控件,可添加背景图片等,有兴趣的可以看看
很好的时间控件,和安卓版的手机上设置时间的控件一样。很好用的,拿出来和大家分享一下
此demo为Android 自定义View实现时间轴,轴的高度可随内容高度自动调整而改变,代码较简单,可供参考