Ie7 / Ie8中的Jquery UI对话框出错

时间:2010-10-05 14:26:36

标签: jquery internet-explorer user-interface dialog modal-dialog

已经解决了Jquery UI对话框的问题。我将它设置为modal:true,所以当我初始化对话框时,我确实看到了灰色叠加层。但是,对话框本身根本不会出现。这是奇怪的部分(也许):当我将设置设置为autoOpen:true时,对话框显示正常,当我点击时它根本不再出现。有任何想法吗?提前致谢。

<script type="text/javascript">
jQuery.noConflict();    
jQuery(document).ready(function(){ 

jQuery('#loginforms').dialog({
        autoOpen: false,
        height: 230,
        width: 330,
        modal: true,
        position: 'center',
        buttons: {
            Cancel: function() { jQuery(this).dialog('close'); },
            "Log in": function() { jQuery('#login').submit(); }
        }
 });

jQuery('#loginbutton li a').click(function(){
                jQuery('#loginforms').dialog('open');
                return false;
                                       });


 });

</script>

...

   <div id="loginforms" style="overflow-x:hidden;">

  <form method="post" action="summary.html" class="forms" id="login">

    <h2 style="font-size:16px; text-align:left;">Please login to your account: </h2><br />

    <label for="name">Name</label>
        <input value="" class="required" id="name" name="name" />

             <label for="password">Password</label>
        <input value="" class="required" id="password" name="password" type="password" />

</form>

</div>

2 个答案:

答案 0 :(得分:1)

我以为我只是发帖,因为我发现了问题。事实证明,这是curvycorners.js和jquery-UI(特别是对话框)之间的不兼容。很抱歉没有反映在我的问题中,我从未想过问题可能就是这样。只是发布在这里以防其他人有类似的问题。

答案 1 :(得分:0)

看来你没有执行Dialog.show,我认为问题出在Anchor的选择器上(链接) 检查绑定Click时返回的包装集。

jQuery('#loginbutton li a').click(function(){

该选择器是否会检索到某些内容?因为我在您的代码示例中没有看到它:S

希望它有所帮助!

相关问题