JQuery UI 对话框仅在加载时显示,而不是在加载完成后显示
首先:以前从未在这里问过问题,但这个社区过去已经为各种事情提供了很大的帮助。非常感谢。
我们的 JQuery UI 对话框遇到问题。当您在页面未加载完成时单击相应的链接时,它们将正常工作并打开。但一旦 Chrome 停止旋转它的小加载东西,你就可以随意点击按钮/链接——什么也不会发生。 我猜代码不会有太大帮助 - 相当标准的教程复制粘贴只是为了让它运行:
<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.1/jquery-ui.min.js"></script>
<script>
function showDialog(){
$(document).ready(function(){
$("#dialog").dialog({
modal: true,
buttons: {"Testbutton": function(){ $(this).dialog("close"); } } });
$("dialog").show();
});
}
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
modal: true
});
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "enable" );
$( "#dialog" ).dialog( "open" );
return false;
});
});
<div id="dialog" title="Basic modal dialog" style="display:none">
<p>dialog text</p>
</div>
<button id="opener">Testdialog</button>
First of all: Never asked a question here before but this community already has been great help in the past for all sorts of stuff. So thanks a lot for that.
We're having a problem with our JQuery UI dialogs. They will work fine and open up when you click on the corresponding link while the page is not done loading. But as soon as Chrome stopped spinning its little loading thingy you can click on the buttons/links all you want- nothings happens.
Code won't help much I guess- pretty standard tutorial copy'n'paste just to get it running:
<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.1/jquery-ui.min.js"></script>
<script>
function showDialog(){
$(document).ready(function(){
$("#dialog").dialog({
modal: true,
buttons: {"Testbutton": function(){ $(this).dialog("close"); } } });
$("dialog").show();
});
}
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
modal: true
});
$( "#opener" ).click(function() {
$( "#dialog" ).dialog( "enable" );
$( "#dialog" ).dialog( "open" );
return false;
});
});
<div id="dialog" title="Basic modal dialog" style="display:none">
<p>dialog text</p>
</div>
<button id="opener">Testdialog</button>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
可能是因为页面稍后出现了 javascript 错误。如果您使用 firebug,您会在 javascript 控制台中看到任何错误吗?
Its probably because you have a javascript error later on in the page. If you use firebug do you see any errors in the javascript console?
已经……解决了!天哪...那是一个很长的路要走。这是非常棘手的问题之一 - 所以这里是解决方案:
http: //code.google.com/p/zfdebug/issues/detail?id=30
非常感谢你们的帮助!当 Ross 询问是否还有其他 JS 错误时,我走上了正确的道路。非常感谢!
Already....got a fix! Holy crap...that was a long way. And it's one of those really tricky ones- so here is the solution:
http://code.google.com/p/zfdebug/issues/detail?id=30
Thank you guys so much for helping! I got on the right path when Ross asked if there are any other JS errors. Thanks a lot for that!