以下fiddle工作正常但是当我在我的网站上尝试相同的代码时根本没有边框它是透明的并且到处都是。
我试图禁用所有的 css 和从 firebug 继承的 css,但它看起来还是一样。
也许它不是现有的 css,而是它需要为对话框定义一些 css,也许 fiddle 会自动包含它但不太确定......
$("#click").click(function (event) {
$("#dialog-confirm").dialog({
resizable: false,
height: 140,
modal: true,
buttons: {
"Yes go ahead": function () {
$(this).dialog("close");
},
Cancel: function () {
$(this).dialog("close");
}
}
});
});
最佳答案
1.import jquery-ui.js file to your page.
2.import jquery-ui.css file as well.
3.Check your code reside in$(document).ready(function(){});
4.If none of them work,open browser console,make a note of the error and comment below..
关于Jquery UI 确认对话框在 fiddle 中完美显示,但不在网站上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18764251/