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

多屏判断css改写

时间:2015-05-27 07:25:17      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

 1 function replaceBodyClass(){
 2     for(var i in map){
 3        if(map[i](width)){
 4           document.body.className = document.body.className.replace(/screen-\w+/, "screen-"+i)
 5           break
 6        }
 7     }
 8 }
 9 
10 map["1280"] = function(width){
11    return width <= 1300
12 }
13 
14 
15 map["x1"] = function(width){
16    return width > = 1580
17 }
18 
19 map["1"] = function(width){
20    return  width > = 1400 && width < 1580
21 }

多屏判断css改写

标签:

原文地址:http://www.cnblogs.com/taoze/p/4532348.html

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