为你而来

2012年6月4日

javascript左右两侧广告的滑动特效

摘要: 1 <html> 2 <head> 3 <title>1</title> 4 <style type='text/css'> 5 #divbox{ 6 border:dashed 1px green; 7 position:absolute; 8 left:100px; 9 top:30px;10 width:100px;11 height:100px;12 }13 </style>14 </head>15 <body>16 <div id='divbox'&g 阅读全文

posted @ 2012-06-04 20:30 为你而来 阅读(451) 评论(0) 推荐(0) 编辑

javascript:apply函数在面向对象中的用法

摘要: 1 <html> 2 <head> 3 <title>1</title> 4 </head> 5 <body> 6 <script language='javascript'> 7 function Point(x,y){ 8 this.x=x; 9 this.y=y;10 this.fun1=function(){11 return this.x+'/'+this.y;12 }13 }14 Point.prototype.valueOf=function(){15 ... 阅读全文

posted @ 2012-06-04 12:30 为你而来 阅读(225) 评论(0) 推荐(0) 编辑

javascript:prototype对象的用法

摘要: 在类而不是变量中,为类定义的名称添加方法。 1 <html> 2 <head> 3 <title>1</title> 4 </head> 5 <body> 6 <script language='javascript'> 7 function Me(){} 8 Me.prototype.fun=function(x){ 9 return x;10 }11 Me.prototype.sun=function(){12 document.write("<font color=' 阅读全文

posted @ 2012-06-04 12:01 为你而来 阅读(110) 评论(0) 推荐(0) 编辑

javascript:event对象

摘要: event.cancelBubble可以阻止事件冒泡 1 <html> 2 <head> 3 <style type='text/css'> 4 div{ 5 border:dashed 1px green; 6 width:200px; 7 height:100px; 8 } 9 </style>10 </head>11 <body id='mybody'>12 <div id='divone'>13 <button id='clickme' 阅读全文

posted @ 2012-06-04 08:58 为你而来 阅读(175) 评论(0) 推荐(0) 编辑

导航