jQuery-向div添加设置宽度? [英] jQuery - add a set width to div?
本文介绍了jQuery-向div添加设置宽度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用jQuery向div
添加一定数量的像素.
I need to add a set number of pixels to a div
with jQuery.
是否有一个简单的命令,还是需要编写一些代码,该代码首先找到元素的宽度,然后添加设置的数量?
Is there an easy command for this or will I need to write some code that first finds the width of the element and then adds the set amount?
推荐答案
或第三个替代方案,
$("#mydiv").css("width", "+=10");
这篇关于jQuery-向div添加设置宽度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文