首页 > Web开发 > 详细

多屏判断css改写

时间:2015-05-27 07:23:00      阅读:299      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!