给定:
<html>
<body class="v4master">
<form id="aspnetForm">
<div id="s4-workspace"></div>
</form>
<div class="ms-dlgContent"></div>
<div class="ms-dlgBorder"></div>
<div class="ms-dlgFrameContainer">
<iframe class="ms-dlgFrame">
<html class="ms-dialog">
<body class="v4master">
<form id="aspnetForm">
<div id="s4-workspace"></div>
</form>
</body>
</html>
</iframe>
</div>
</div>
</div>
</body>
如何使用 jquery 更改第一个“s4-workspace”的高度,同时将其保留在 iframe 中?我更愿意使用这样的方法:
jQuery('#s4-workspace').css('cssText', 'height: ' + NewHeight + 'px;');
最佳答案
jQuery 不会定位 #s4-workspace
里面<iframe>
无论如何,因为其中的内容属于并行 DOM。除此之外,你应该使用
jQuery('#s4-workspace').css('height', NewHeight);
关于jquery - 调整特定 div 的大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33572636/