我正在将一个对象(图像)复制到另一个元素中。如何在运行中更改目标元素中显示的大小?
<div id="eleWithImgs">
<img id="ph01" src=".../image01.jpg">
<img id="ph02" src=".../image02.jpg">
...
$('#eleWithImgs').children().each(function() {
$($(this), {
width: // ??
height: // ??
}).clone().appendTo('#destinationEle');
});
答案 0 :(得分:1)
为克隆元素设置CSS属性:
$('#eleWithImgs').children().each(function () {
$(this).clone().css({
width: // ??
height: // ??
}).appendTo('#destinationEle');
});
我希望你的问题不是如何填写??
...