码迷,mamicode.com
首页 > Web开发 > 详细

jquerylike wrap

时间:2014-11-06 12:17:24      阅读:152      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   sp   div   on   log   cti   

 1 function $(selector){
 2  return new O(document.getElementById(selector));
 3 }
 4 function O(ele){
 5  this.ele=ele;
 6 }
 7 O.prototype.show=function(){
 8  this.ele.style.display=‘‘;
 9  return this;
10 };
11 O.prototype.hide=function(){
12  this.ele.style.display=‘none‘;
13  return this;
14 };
15 $(‘#id‘).show().hide();

 

jquerylike wrap

标签:style   blog   io   color   sp   div   on   log   cti   

原文地址:http://www.cnblogs.com/rocky2/p/4078080.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!