jQuery可调整大小的同步调整大小

时间:2015-06-10 13:03:26

标签: javascript jquery html

我想问一下如何修复可调整大小的jquery。我想要的是如果我调整父元素的大小,它也会调整父元素内部的子元素大小。这是我目前的代码:

<div id="img_holder" style="width:100px;height:120px;float:left;margin:5px;">
    <a href="#" target="_blank" class="thumbnail" style="text-decoration:none;height:120px;">
        <img src="suits.jpg" style="height:110px !important;" />
    </a>
</div>

$("#img_holder").resizable({alsoResize: "#img_holder a, #img_holder a img"});

这是调整大小时的输出 enter image description here

谢谢!

1 个答案:

答案 0 :(得分:0)

示例中的锚点和图像已预设height,因此它们不会调整到大于设定高度的高度。我还注意到img高度是使用!important设置的。