Jquery ui 如何防止jQueryUI对话框修改后台布局?

Jquery ui 如何防止jQueryUI对话框修改后台布局?,jquery-ui,Jquery Ui,我使用jqueryui在页面加载时提供一个模式窗口。这很好,但是,与它应该的方式相比,背景布局是混乱的 以下是对话框代码: <div id="dialog" title="Dialog Title"> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim a

我使用jqueryui在页面加载时提供一个模式窗口。这很好,但是,与它应该的方式相比,背景布局是混乱的

以下是对话框代码:

<div id="dialog" title="Dialog Title">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
以下是页面的外观:

这是jquery对话框就位后的外观:

有可能既吃蛋糕又吃蛋糕吗


谢谢。

可能需要使用就绪功能。当文档准备好时,您需要加载它

$(文档).ready(函数(){

你的网站对我来说加载速度很慢,所以我甚至不能看源代码。但是试试看

一定是别的原因,因为这确实有效

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>


<link type="text/css" href="jquery-ui-1.8.5.custom.css" rel="stylesheet" /> 

        <script type="text/javascript">
            $(document).ready(function (){
                // Dialog           
                $('#dialog').dialog({
                    autoOpen: true,
                    width: 300,
                    buttons: {
                        "Ok": function() { 
                            $(this).dialog("close"); 
                        }, 
                        "Cancel": function() { 
                            $(this).dialog("close"); 
                        } 
                    }
                });

                // Dialog Link
                $('#dialog_link').click(function(){
                    $('#dialog').dialog('open');
                    return false;
                });

                //hover states on the static widgets
                $('#dialog_link, ul#icons li').hover(
                    function() { $(this).addClass('ui-state-hover'); }, 
                    function() { $(this).removeClass('ui-state-hover'); }
                );

            });
        </script>
        <style type="text/css">
            /*demo page css*/
            #dialog_link {padding: .4em 1em .4em 20px;text-decoration: none;position: relative;}
            #dialog_link span.ui-icon {margin: 0 5px 0 0;position: absolute;left: .2em;top: 50%;margin-top: -8px;}
            ul#icons {margin: 0; padding: 0;}
            ul#icons li {margin: 2px; position: relative; padding: 4px 0; cursor: pointer; float: left;  list-style: none;}
            ul#icons span.ui-icon {float: left; margin: 0 4px;}
        </style>    


<style type="text/css">
<!--
.style2 {
    font-size: 12px
}
-->
</style>


</head>

<body class="home">
      <div id="dialog" title="Dialog Title">
            <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
        </div>


</body>
</html>

$(文档).ready(函数(){
//对话
$('#dialog')。dialog({
自动打开:对,
宽度:300,
按钮:{
“Ok”:函数(){
$(此).dialog(“关闭”);
}, 
“取消”:函数(){
$(此).dialog(“关闭”);
} 
}
});
//对话框链接
$(“#对话框_链接”)。单击(函数(){
$('dialog')。dialog('open');
返回false;
});
//静态小部件上的悬停状态
$(“#对话框#链接,ul#图标li”)。悬停(
函数(){$(this.addClass('ui-state-hover');},
函数(){$(this).removeClass('ui-state-hover');}
);
});
/*演示页面css*/
#对话框链接{填充:.4em 1em.4em 20px;文本装饰:无;位置:相对;}
#对话框链接span.ui-图标{页边距:0 5px 0;位置:绝对;左侧:.2em;顶部:50%;页边距顶部:-8px;}
ul#图标{边距:0;填充:0;}
ul#图标li{边距:2px;位置:相对;填充:4px 0;光标:指针;浮点:左;列表样式:无;}
ul#icons span.ui-icon{float:left;margin:04px;}
知识本身是一种美德,是一种美德,是一种美德,是一种美德,是一种美德,是一种美德,是一种美德,是一种美德,是一种美德,是一种美德,是一种美德

好的,这是一个CSS问题。jquery ui使用一些通用的CSS规则。比如状态悬停、小部件ui等。你在jquery CSS文件和base.CSS文件中定义了它们。你需要拿出你不需要的东西

jQuery UI对话框插件使用jQuery UI CSS框架设计其外观,包括颜色和背景纹理。我们建议使用ThemeRoller工具创建和下载易于构建和维护的自定义主题

If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below.
Sample markup with jQuery UI CSS Framework classes
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable">
   <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
      <span id="ui-dialog-title-dialog" class="ui-dialog-title">Dialog title</span>
      <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
   </div>
   <div style="height: 200px; min-height: 109px; width: auto;" class="ui-dialog-content ui-widget-content" id="dialog">
      <p>Dialog content goes here.</p>
   </div>
</div>
如果需要更深层次的定制,jquery.ui.dialog.css样式表中会引用一些特定于小部件的类,这些类可以修改。这些类在下面以粗体显示。
jQueryUICSS框架类的示例标记
对话标题
对话框内容在这里


你好,Matt。看起来像是服务器问题。我会尝试一下,让您知道它是如何运行的。谢谢。
If a deeper level of customization is needed, there are widget-specific classes referenced within the jquery.ui.dialog.css stylesheet that can be modified. These classes are highlighed in bold below.
Sample markup with jQuery UI CSS Framework classes
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable">
   <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
      <span id="ui-dialog-title-dialog" class="ui-dialog-title">Dialog title</span>
      <a class="ui-dialog-titlebar-close ui-corner-all" href="#"><span class="ui-icon ui-icon-closethick">close</span></a>
   </div>
   <div style="height: 200px; min-height: 109px; width: auto;" class="ui-dialog-content ui-widget-content" id="dialog">
      <p>Dialog content goes here.</p>
   </div>
</div>