//------------------------------------------------------------------------------ // // 旧形番代替品検索 タブの高さを自動調整する。 // //------------------------------------------------------------------------------ var objDivTabs = null; window.addEventListener( "load", function() { objDivTabs = document.getElementById( "tabs"); if ( objDivTabs) { $( "#tabs").tabs({ select: function( event, ui) { var iframe = $( "#tabs-" + String( ui.index + 1) + " iframe"); var timer = setInterval( function() { if ( !$( iframe).is( ":visible")) return; clearInterval( timer); adjustTabsHeight(); }, 100) ; }, }); } else { objDivTabs = document.getElementById( "tabs-1"); } $( "iframe", objDivTabs).each( function( index, iframe) { $( iframe).contents().find( "#content").css( "min-height", "0px"); $( iframe).contents().find( "body").css( "overflow-y", "hidden"); if ( $( iframe).is( ":visible")) adjustTabsHeight(); }); $( "#tabs-1 iframe")[ 0].contentWindow.oTable.dataTableSettings[ 0].aoDrawCallback.push({ "fn": function( oSettings ) { adjustTabsHeight(); }, "sName": "adjustIframe" }); }); window.addEventListener( "resize", adjustTabsHeight); function adjustTabsHeight() { var iframe = null; $( "iframe", objDivTabs).each( function( index, elmIframe) { if ( $( elmIframe).is( ":visible")) { iframe = elmIframe; return true; } }); if ( iframe == null) return; $( iframe).height( iframe.contentWindow.document.documentElement.offsetHeight + ( iframe.contentWindow.innerHeight - $( iframe.contentWindow).height()) // 横スクロールバーの高さ ); $( iframe).parent().height( $( iframe).outerHeight( true)); var minHeight = $( "#left_area_inner").outerHeight( true) - ( $( objDivTabs).offset().top - $( "#content_inner").offset().top) - ( $( objDivTabs).outerHeight( true) - $( objDivTabs).height()) ; var dstHeight = $( "#ultabs").outerHeight( true) + $( iframe).parent().outerHeight( true); $( objDivTabs).height( minHeight > dstHeight ? minHeight : dstHeight); $( "#left_area").height( $( "#content").outerHeight( true) - ( $( "#left_area").outerHeight( true) - $( "#left_area").height()) ); }