使用jQuery更改DIV维度
我的标记中有以下div使用jQuery更改DIV维度,jquery,html,Jquery,Html,我的标记中有以下div <div id="sectionContent" style="position: absolute; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; z-index: 1; top: 56px; bottom: 6px; left: 8px; right: 8px; width: 722px; height: 624px; visibility: visible;
<div id="sectionContent" style="position: absolute; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; z-index: 1; top: 56px; bottom: 6px; left: 8px; right: 8px; width: 722px; height: 624px; visibility: visible; display: block;">
<div id="actionArea" style="text-align: left; margin-bottom: 2px;">
<button id="addNote"><span class="ui-button-text">Aggiungi Nota</span></button>
</div>
<!-- Contains all the notes and limits their movement -->
<div style="margin: 0 auto; position:relative; width:100%; height: 100%; z-index: 10;">
</div>
</div>
阿吉恩吉诺塔酒店
外部DIV“sectionContent”在运行时由jquery插件自动设置大小,jquery插件提供页面布局。在这里面,我有一个按钮(“actionArea”)的第一个DIV和一个id=“notesDesktop”的DIV
我想为“notesDesktop”DIV设置一个大小,即
- 宽度等于“sectionContent”DIV
- 高度等于“sectionContent”DIV减去“actionArea”DIV的高度
非常感谢您的帮助这应该可以做到:
$("#notesDesktop").width($("#sectionContent").width());
$("#notesDesktop").height($("#sectionContent").height() - $("#actionArea").height());