簡體   English   中英

Internet Explorer 8上未顯示JQuery UI對話框滾動條

[英]JQuery UI Dialog Scrollbars not Showing on Internet Explorer 8

我使用顯示單獨頁面的JQuery UI在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:visibleoverflow:auto可以解決問題,但這對我來說還行不通。 如果是的話,這可能是jquery-ui版本的錯誤嗎?如何解決?

非常感謝您的時間和幫助。

盡管看起來很傻,但是我將呈現的iframe的scrolling="no"屬性更改為scrolling="yes"並解決了。

function showRegDialog(url) {

idNro = Math.floor((Math.random() * 1500) + 1);
$(function () { var horizontalPadding = 0;
var verticalPadding = 0;

$('<iframe id="externalSite' + idNro + '" scrolling="yes" 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);    
        });
}

謝謝。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM