首页 新闻 赞助 找找看

我想用js付个高度值

0
悬赏园豆:10 [已解决问题] 解决于 2012-11-22 08:36

document.getElementById("boxrightdefalut").style.height = /**这里的值是(auto !important),该怎么写**/;

严文Live的主页 严文Live | 初学一级 | 园豆:11
提问于:2012-11-19 14:53
< >
分享
最佳答案
0

document.getElementById("boxrightdefalut").style.height="50px"

收获园豆:10
chenping2008 | 大侠五级 |园豆:9836 | 2012-11-19 20:26

这样写不行,我想写   "height:auto"

严文Live | 园豆:11 (初学一级) | 2012-11-21 11:42

@严文Live: document.getElementById("main").style.height="auto";

chenping2008 | 园豆:9836 (大侠五级) | 2012-11-21 13:09

@chenping2008: 我也这样写过,也没反应,看不到样式

严文Live | 园豆:11 (初学一级) | 2012-11-21 16:27

@严文Live: 没有效果,也许在你的页面,定义auto就是该那个样子显示

chenping2008 | 园豆:9836 (大侠五级) | 2012-11-21 21:22

@chenping2008: 这个写法是对的!

Vincent.Pei | 园豆:156 (初学一级) | 2012-11-23 11:00
其他回答(3)
0

document.getElementById("boxrightdefalut").style="height =10";

杜昊东 | 园豆:246 (菜鸟二级) | 2012-11-19 14:57

这样写不行,我想写   "height:auto"

支持(0) 反对(0) 严文Live | 园豆:11 (初学一级) | 2012-11-21 11:42
2

写个样式class

然后前台给控件切换class

飞来飞去 | 园豆:2057 (老鸟四级) | 2012-11-19 15:51
0

document.getElementById("boxrightdefalut").style="height:10px";

Vincent.Pei | 园豆:156 (初学一级) | 2012-11-19 17:10

这样写不行,我想写   "height:auto"

支持(0) 反对(0) 严文Live | 园豆:11 (初学一级) | 2012-11-21 11:42
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册