摘要:        
undefined 声明的变量尚未初始化 null 对象尚未存在 eg: var a; console.log(typeof a); 输出undefined var b= document.getElementById("b"); console.log(typeof b); console.log    阅读全文
posted @ 2016-10-23 20:22
炎泽
阅读(322)
评论(0)
推荐(0)
        
            
        
        
摘要:        
calc()可以给元素做运算, calc(expression) eg: .a { width: -webkit-calc(100% - 2px); width: -moz-calc(100% - 2px); width: calc(100% - 2px); } 语法: 1.可以使用+ - * %(    阅读全文
posted @ 2016-10-23 19:46
炎泽
阅读(212)
评论(0)
推荐(0)
        
            
        
        
摘要:        
style.cssText 用来获取/设置元素的样式 设置: <div id= "a" style= "background: red;"> document.getElementById("a").style.cssText= "width: 200px; height: 200px"; 设置成功    阅读全文
posted @ 2016-10-23 18:56
炎泽
阅读(153)
评论(0)
推荐(0)
        
            
        
        
摘要:        
js ondblclick 兼容性良好,在移动端使用无效 jQuery dblclick()    阅读全文
posted @ 2016-10-23 18:48
炎泽
阅读(257)
评论(0)
推荐(0)
        
            
        
        
摘要:        
代码如下: 解析: document.oncontextmenu: oncontextmenu方法在目标元素上右键时触发,兼容性良好 var e= event || window.event;e.preventDefault? e.preventDefault():e.returnValue= fa    阅读全文
posted @ 2016-10-23 15:40
炎泽
阅读(196)
评论(0)
推荐(0)
        
            
        
        
摘要:        
addEventListener:添加事件监听器 element.addEventListener(event, function, useCapture) event:事件类型,字符串,不要加"on" function:函数名,也可以就是一个函数(不推荐这么写,这样写无法取消!) useCaptu    阅读全文
posted @ 2016-10-23 14:00
炎泽
阅读(743)
评论(0)
推荐(0)
        
            
        
        
摘要:        
按键会触发按键事件(KeyboardEvent{}),触发顺序为keydown,keypress,keyup 组合键是,即使输入一个字符,也会触发多次keydown,keyup事件 eg:<div class="aa" contenteditable="true" onkeydown="a(even    阅读全文
posted @ 2016-10-23 12:57
炎泽
阅读(430)
评论(0)
推荐(0)
        
 
                    
                     
                    
                 
                    
                
 
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号