(function(window){
var com = function(box){
this.box = document.querySelector(box);
}
window.zhanglei = function(box){
return new com(box);
}
com.prototype ={
addClass:function(cls){
if('classList' in this.box){
this.box.classList.add(cls);
}else{
var preCls = this.box.className;
var newCls = preCls +' '+ cls;
this.box.className = newCls;
}
return this.box;
}
} })(window)
zhanglei('.box').addClass('zhang');

  

dddddd的更多相关文章

  1. 字符串aaaa......bbbb....ccc...dddddd用正则替换为abcd

    public static void main(String[] args) { String s = "aaaa......bbbb....ccc...dddddd"; Stri ...

  2. 基于ABP实现DDD--DDD相关概念

      什么是DDD呢?领域驱动设计[DDD]是一种针对复杂需求的软件开发方法.将软件实现与不断发展的模型联系起来,专注于核心领域逻辑,而不是基础设施细节.DDD适用于复杂领域和大规模应用,而不是简单的C ...

  3. LeetCode-5LongestPalindromicSubstring(C#)

    # 题目 5. Longest Palindromic Substring Given a string S, find the longest palindromic substring in S. ...

  4. Vue-Router 页面正在加载特效

    Vue-Router 页面正在加载特效 如果你在使用 Vue.js 和 Vue-Router 开发单页面应用.因为每个页面都是一个 Vue 组件,你需要从服务器端请求数据,然后再让 Vue 引擎来渲染 ...

  5. 十分钟玩转 jQuery、实例大全

    一.简介 定义 jQuery创始人是美国John Resig,是优秀的Javascript框架: jQuery是一个轻量级.快速简洁的javaScript库.源码戳这 jQuery对象 jQuery产 ...

  6. DOM、BOM 操作超级集合

    本章内容: 定义 节点类型 节点关系 选择器 样式操作方法style 表格操作方法 表单操作方法 元素节点ELEMENT 属性节点attributes 文本节点TEXT 文档节点 Document 位 ...

  7. CodingLife主题更新

    收到反馈说CodingLife主题某些地方显示有问题,于是进行了更新,并且已提交.官方那边正在进行测试,我自己这边测完应该是没问题的,但不知道官方啥时候会进行更新,所以把CSS代码贴出来,有需要的可以 ...

  8. C#与C++的发展历程第四 - C#6的新时代

    *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...

  9. HTML5移动开发学习笔记之CSS3基础学习

    CSS回顾 在学CSS3之前首先巩固下CSS的基础知识. 1.CSS框模型 举例子: #box { width: 70px; margin: 10px; padding: 5px; } 这个代码将出现 ...

随机推荐

  1. Chrome 浏览器提示adobe flash player不是最新版本

    百度下载最新版. 刷新 Chrome浏览器.更换其他的浏览器. 刷新过后,无效. 打开Flash Player 检查安装的版本. IE会链接到官网. 对应自己的系统.找到自己用的浏览器.看是否一致. ...

  2. "System Protection" is disabled in Win10 default settings

    We could find some important clue in Restore Point because "System Protection" of volume C ...

  3. 阅读{django-restframework}源码[generics.py]学习笔记

    首先django-restframework是基于django的一个框架.   mixins.py中开头是这样写的: Basic building blocks for generic class b ...

  4. ZYNQ 的PS GEM DMA存在缺陷

    使用iperf对zynq进行单socket tcp传输速率测试: 无网络损伤时,单向网络带宽约为600Mbps,双向网络带宽相加约400Mbps: 50ms延时,1ms抖动,无丢包时,单向网络带宽约为 ...

  5. Msql:Incorrect double value: ''for column 'id' at row 1解决

    Incorrect double value: ''for column 'id' at row 1解决   最近在写个查询 插入语句的时候 我是这么写的 1 insert into test val ...

  6. asp.net 查询好的数据后 排序显示在桌面上

    select top 10 * ,row()_number over ( order by 字段 desc) as rownum  from  表 row()_number;简单的说row_numbe ...

  7. VUE 入门基础(5)

    五,Class 与 Style 绑定 绑定HTML class 对象语法 我们可以传给v-bind:class 一个对象,以动态的切换class <div v-bind:class=" ...

  8. android 判断sd的状态,所有文件,剩余空间的大小

    public class MainActivity extends AppCompatActivity { String TAG = MainActivity.class.getCanonicalNa ...

  9. MySQL_积分兑换的优惠券在某时间段内使用情况_ 20161215

    积分兑换的优惠券在某时间段内使用情况 SELECT a.城市,a.用户ID,a.优惠券ID,a.优惠券名称,a.积分兑换优惠券的张数,b.使用优惠券数量,a.积分兑换优惠券的金额,b.使用优惠券金额 ...

  10. mysql ERROR 1062: ALTER TABLE causes auto_increment resequen

    当我用Navicat尝试修改已有记录的mysql数据表的主键为自动增长时,报出以下错误 1602 ALTER TABLE causes auto_increment resequencing, res ...