设置div jquery的宽度 [英] setting width of div jquery
本文介绍了设置div jquery的宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用jquery设置div的宽度。
I'm trying to set the width of a div using jquery.
这是我如何设置div的大小
this is how I'm trying to set the size of the div
$('#page').css("width",data[0]['imageWidth']);
这是我要设置的div
and this is the div I'm trying to set
<div id="page">
</div>
任何帮助将非常感谢
推荐答案
在CSS长度需要一个单位,在这种情况下最有可能是像素( px
):
In CSS lengths require a unit, in this case most likely Pixel (px
):
$('#page').css("width",data[0]['imageWidth'] + "px");
这篇关于设置div jquery的宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文