gpt4 book ai didi

javascript - jQuery UI 对话框 - 缺少关闭图标

转载 作者:IT老高 更新时间:2023-10-28 13:16:06 28 4
gpt4 key购买 nike

我正在使用自定义 jQuery 1.10.3 主题。我直接从主题滚轴下载了所有内容,但我故意没有更改任何内容。

我创建了一个对话框,我得到一个空白的灰色方 block ,其中应该是关闭图标: Screen shot of missing close icon

我比较了我页面上生成的代码:

<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
<spanid="ui-id-2" class="ui-dialog-title">Title</span>
<button class="ui-dialog-titlebar-close"></button>
</div>

Dialog Demo page上生成的代码:

<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
<span id="ui-id-1" class="ui-dialog-title">Basic dialog</span>
<button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close">
<span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span>
<span class="ui-button-text">close</span>
</button>
</div>

编辑

代码的不同部分由 jQueryUI生成,不是我,所以我不能只添加 span 标签而不编辑 jqueryui js 文件,这似乎是实现正常的错误/不必要的选择功能。

这是生成该部分代码的 JavaScript:

this.element.dialog({
appendTo: "#summary_container",
title: this.title(),
closeText: "Close",
width: this.width,
position: {
my: "center top",
at: ("center top+"+(window.innerHeight*.1)),
collision: "none"
},
modal: false,
resizable: false,
draggable: false,
show: "fold",
hide: "fold",
close: function(){
if(KOVM.areaSummary.isVisible()){
KOVM.areaSummary.isVisible(false);
}
}
});

我不知所措,需要帮助。

最佳答案

我迟到了一段时间,但我要让你大吃一惊,准备好了吗?

发生这种情况的原因是,在您调用 jquery-ui 之后,您正在调用 bootstrap。

从字面上看,交换两者,而不是:

<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="js/bootstrap.min.js"></script>

变成了

<script src="js/bootstrap.min.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>

:)

Edit - 26/06/2015 - this keeps attracting interest months later so I thought it was worth an edit. I actually really like the noConflict solution offered in the comment underneath this answer and clarified by user Pretty Cool as a separate answer. As some have reported issues with the bootstrap tooltip when the scripts are swapped. I didn't experience that issue however because I downloaded jquery UI without the tooltip as I didn't need it because bootstrap. So this issue never came up for me.

Edit - 22/07/2015 - Don't confuse jquery-ui with jquery! While Bootstrap's JavaScript requires jQuery to be loaded before, it doesn't rely on jQuery-UI. So jquery-ui.js can be loaded after bootstrap.min.js, while jquery.js always needs to be loaded before Bootstrap.

关于javascript - jQuery UI 对话框 - 缺少关闭图标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17367736/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com