2
我具有低於此HTML
代碼:確定可調整大小的事業部如果它保持其寬高比調整大小時
<div id="myid_templates_editor_text_1" class="myid_templates_editor_element myid_templates_editor_text ui-resizable ui-draggable" style="width: 126.79999999999998px; height: 110px; position: absolute; left: 196px; top: 76px; -webkit-transform: rotate(0deg); border: hidden;">
<div class="myid_templates_editor_text_dynamic_part"><p><strong>dsdasadsd</strong></p></div><div class="ui-resizable-handle ui-resizable-e" style="z-index: 90;"></div>
<div class="ui-resizable-handle ui-resizable-s" style="z-index: 90;"></div>
<div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se" style="z-index: 90;"></div>
</div>
我具有id myid_templates_editor_text_1
可調整大小所作的div
並保持其高寬比,通過Jquery Plugin
。
$('#myid_templates_editor_text_1').resizable({
animate: true,
aspectRatio: true
});
有時,我已禁用功能'保持縱橫比'。請參見下面的代碼:
$('#myid_templates_editor_text_1').resizable({
animate: true,
aspectRatio: false
});
我將如何確定div
的保持寬高比只是着眼於HTML Code
或javascript
或jquery
功能?那可能嗎?
謝謝,但是當我顯示aspectRatio變量。它說'[對象對象]'。我期待一個布爾值。無論是真或假。 – Qerjiuthn
不知道你有什麼問題,但它的工作原理。使用演示查看更新的答案。 – billynoah
謝謝,我的代碼中的東西已經搞亂了。你的回答是對的。 – Qerjiuthn