2013-06-04 45 views
4

我正在使用jQuery 1.10.1与迁移,jQueryUI 1.10.3,jQueryValidate 1.11.1。jQuery UI 1.10.3对话框,拖动对话框

只要使用简单的形式,它有两个字段。如果未提供值,请在提交时显示一个对话框并显示消息。

Issue:在IE 10中当用户尝试移动(拖动)错误消息对话框时,它会向下移动。这只有在浏览器窗口中出现垂直滚动条时才会发生。 在Chrome 27中验证了它的效果。有时会在Firefox 21和Opera 12.15中出现相同的问题。

注意:它与jQuery UI 1.10.2正常工作,唯一的问题是在1.10.3中有问题。

样品来源

<html> 
<head> 
    <style type="text/css"> 
     .label {width:100px;text-align:right;float:left;padding-right:10px;font-weight:bold;} 
     .label1 {width:350px; text-align:right; padding-top:300px;padding-bottom:30px; font-weight:bold; } 
    </style> 

    <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> 
    <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> 
    <script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script> 

    <!-- <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.min.js"></script> --> 
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.3/jquery-ui.min.js"></script> 

    <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script> 

    <script> 
    $(function() { 
     $("#register-form").validate({ 
      rules: { firstname: "required", lastname: "required" }, 
      messages: { firstname: "Need First Name", lastname: "Need Last Name" }, 
      showErrors: function(errorMap, errorList) { 
         $("#diverror").dialog({ modal: true }); 
      }, 
      submitHandler: function(form) { 
       form.submit(); 
      } 
     }); 
    }); 
    </script> 
</head> 
<body> 
    <form method="post" id="register-form"> 
     <div class="label">First Name</div><input type="text" id="firstname" name="firstname" /><br /> 
     <div class="label">Last Name</div><input type="text" id="lastname" name="lastname" /><br /> 

     <div class="label1">Making page to scroll. Scroll down to submit</div> 
     <div class="label1">Making page to scroll. Scroll down to submit</div> 
     <div class="label1">Making page to scroll. Scroll down to submit</div> 

     <div style="margin-left:140px;"><input type="submit" name="submit" value="Submit" /></div> 
    </form> 
    <div id="diverror" title="Basic dialog"><p>This is the default DIVERROR which is useful for displaying information.</p></div> 
</body> 
</html> 
+0

哎呀我现在失去了2小时后,同样的问题,得到了问题的镀铬! – Ali

+0

此问题已在** jQuery UI 1.10.4 **中修复。 – Rajeev

回答

5

验证的jQuery UI的网站,其在jQuery UI的一个bug。

票务#9354:http://bugs.jqueryui.com/ticket/9354

票务#9315:http://bugs.jqueryui.com/ticket/9315

+0

我刚刚花了最后3个小时来调试我的代码。我认为这是我自己的代码中导致冲突的事情。希望我在3小时前第一次搜索时发现了这个问题。 – toxalot

+0

谢谢我想我会回到旧版本然后 – Ali

+0

yayyy事情在v1.9.2正常工作 – Ali