开发者

jQuery Find Width of Block Element

开发者_C百科Is there an easy way to determine the width of a block element if it were to be inline? I can't make the elements inline so I need some way to determine how wide it should be and then modify the width.


I seem to have done it with the help of polyhedron. Here is the code if someone finds it on Google.

$("h1").each(function() {
    $(this).css("display","inline").css({width: $(this).width(), display: "block"});
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜