DIVの内部に埋め込まれたIFrameソース(JQuery-UI Datepicker)があります。ユーザーがiframeの内側をクリックして日付を選択すると、iframeの幅と高さが増えて、datepicker-calenderの高さに合わせる必要があります。日付ピッキングが完了すると、IFrameは元のサイズに戻ります。DIV要素内のIFrameをユーザーがクリックしたときに自動展開する方法
JSFiddle:https://jsfiddle.net/Jersey_Guy/yoc9jewv/
$(document).ready(function() {
//debugger;
var $w = $(window),
$dateframe = $("iframe[src*='jqueryui']");
$dateframe.blur(function() {
console.log("Called Resize");
$(this).width = 100;
$(this).height = 100;
}).resize();
$dateframe.click(function() {
console.log("Called Resize");
$(this).width(200);
$(this).height(400);
}).resize();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="tab-zone tab-widget tabZoneSelected tabSuppressVizTooltipsAndOverlays tabZone-web fade-bg" id="tabZoneId1" style="z-index: 17; background-color: rgba(255, 255, 255, 0); width: 474px; height: 127px; top: 5px; left: 3px;">
Outer Div
<div class="tab-web tab-widget fade-in">
Inner Div
<div style="position: absolute;">
IFrame Floater Div
<iframe name="frame_1" src="https://jqueryui.com/resources/demos/datepicker/default.html" style="border: 0px none; width: 200px; height: 80px; top: 0px; left: 0px;">
</iframe>
End IFrame Div
</div>
End Inner Div
</div>
End Outer Div
</div>
私はIFrameのサイズと一緒にdivのサイズを設定する必要がありますか? どこが間違っていますか?
は、iFrameのクロスドメインのですか? – dprogramz
実際のケースではそうではありませんが、例では異なるソースからhtmlを使用しています。 –