別のページを表示するJQueryUIを使用してiframeにモーダルダイアログを設定しています。ページコンテンツの高さがダイアログの高さよりも大きい場合、Firefoxではスクロールバーが少し右に表示されますが、Internet Explorer 8またはChromeを使用すると、スクロールバーが表示されません。私のコードは次のようになります:
ライブラリの呼び出し元コード:
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.9.1/jquery-ui.js"></script>
別の.jsファイルでダイアログを開くためのコード:
function showRegDialog(url) {
idNro = Math.floor((Math.random() * 1500) + 1);
$(function () {
var horizontalPadding = 0;
var verticalPadding = 0;
$('<iframe id="externalSite' + idNro + '" scrolling="no" frameborder="0" padding="0" margin="0" style="overflow:auto" class="externalSite" src="' + url + '" />').dialog({
open: function () {
$(this).siblings('.ui-dialog-titlebar').remove();
},
title: false,
autoOpen: true,
width: 750,
height: 700,
modal: true,
resizable: false,
draggable: false,
autoResize: false,
overlay: {
opacity: 0.5,
background: "black"
}
}).width(550).height(700);
});
}
オープナーページには次のものがあります。
<style type="text/css">
html {overflow : visible}
</style>
<body>
<ul>
<li><a href="javascript:showRegDialog('view_edit.aspx?c=1');"> Edit<img src="images/btn/edit_pv.png" align="Absbottom" border="0"/></a>
</li>
</ul>
<!--...-->
</body>
別のコンテンツページには次のものがあります。
<style type="text/css">
.viewEdit
{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px
}
.viewEditForm
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px
}
.viewEditMainDiv
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px
}
</style>
<body class="viewEdit" style="overflow-x:hidden">
<form id="form1" class="viewEditForm">
<div class="viewEditMainDiv">
<!--...-->
</div>
</form>
</body>
これらのスクロールバーをIEとChromeに表示するにはどうすればよいですか。私はかなりの量の研究を行っており、そのトリックを実行するoverflow:visible
か、実行するようoverflow:auto
ですが、これはまだうまくいきません。もしそうなら、jquery-uiバージョンのバグである可能性があります。どうすれば修正できますか?
お手数をおかけしますが、よろしくお願いいたします。