forked from limingziqiang/functions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresize.js
More file actions
24 lines (23 loc) · 785 Bytes
/
resize.js
File metadata and controls
24 lines (23 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* @description resize的操作
* @author 未知
*/
(function(){
var fn = function(){
var w = document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth
,r = 1255
,b = Element.extend(document.body)
,classname = b.className;
if(w < r){
//当窗体的宽度小于1255的时候执行相应的操作
}else{
//当窗体的宽度大于1255的时候执行相应的操作
}
}
if(window.addEventListener){
window.addEventListener('resize', function(){ fn(); });
}else if(window.attachEvent){
window.attachEvent('onresize', function(){ fn(); });
}
fn();
})();