JQuery获取、设置样式height、width的值

(1)今天学会了用JQuery怎样获取、设置样式的高度和宽度

(2)

eq:

<p style="20em;">This is just a test.</p>

width() 取得第一个匹配元素当前计算的宽度值(px)。

示例:

$("p").width();

//设置内容为自拉伸的is

<script type="text/javascript">
    $(function () {
        var st = $(".VideoNote");
        if (st.height() < 378) {
            $(".VideoNote").css("height", "379");
        }
    })

</script>

原文地址:https://www.cnblogs.com/lykbk/p/hghu34343.html