Som*_*neS 2 jquery
我需要使用jquery设置图像的特定宽度和高度(在css中),但仅适用于一个div中的第一个图像.它是posibble吗?
the*_*dox 8
#your_div 是指包含图像的div,可能是你的其他东西.
#your_div
$('#your_div img:first').css({ height: 200, // also use '200px' or something other width: 200 // '200px' or something other });
替代的img:first是img:eq(0).
img:first
img:eq(0)
阅读jQuery :first和:eq()
:first
:eq()
归档时间:
13 年,12 月 前
查看次数:
1327 次
最近记录: