gpt4 book ai didi

jquery - SimpleModal 不会为我关闭

转载 作者:行者123 更新时间:2023-11-28 14:43:46 24 4
gpt4 key购买 nike

您好: 我打算使用 rel 属性打开几个对话框。我知道我遗漏了一些非常基本的东西,但我就是无法关闭它......(这个系统只允许我使用 2 个“a”标签,所以我用“alink”链接......它真的是一个,虽然)

这是 HTML:

<div class="tool" id="first">
<alink class="modalCloseImg" href="#"></alink>
First Content
</div>
<div class="tool" id="second">
<link class="modalCloseImg" href="#"></link>
Second Content
</div>

链接如下:

<div id="toolbox">
<ul>
<li><a href="#" rel="#first">First</a></li>
<li><a href="#" rel="#second">Second</a></li>
</ul>
</div><!-- toolbox -->

这是 CSS:

.tool {
/* initially overlay is hidden */
display:none;
/* some padding to layout nested elements nicely */
padding: 10px 10px 65px 10px;
/* a little styling */
font-size:11px;
overflow: auto;
background-color: #fff;
border: 10px double black;
height: 75%;
min-width: 75%;
width: auto;
position: relative;
}

.tool a.modalCloseImg {
background:url(images/x.png) no-repeat;
width:25px;
height:29px;
display:inline;
z-index:3200;
position:absolute;
top:0px;
right:0px;
cursor:pointer;
border: 0;
text-decoration: none;
}

这是 JQUERY(我在 Wordpress no-conflict- $j 中)

$j("#toolbox a[rel]").click(function(){
var toshow = this.rel;
$j(toshow).modal({
autoResize: false,
overlayClose:true,
containerCss: {
"background-color": "#aaa"
},
overlayCss: {
"background-color": "#fff"
},
onOpen: function (dialog) {
dialog.overlay.fadeIn('slow', function () {
dialog.data.hide();
dialog.container.fadeIn('slow', function () {
dialog.data.slideDown('slow');
});
});
},
onClose: function (dialog) {
dialog.data.fadeOut('normal', function () {
dialog.container.slideUp('fast', function () {
dialog.overlay.fadeOut('fast', function () {
//Close the dialog.
$j(toshow).close();
});
});
});
}


}); // jQuery object; this demo

问题是关闭“工具” 当我点击 X 时什么也没有发生...同样,我知道这一定很简单,但我很快就没头发了!!!

提前致谢!布莱恩

最佳答案

尝试将点击处理程序中的 this 对象更改为 jQuery 对象:

var toshow = $(this).attr("rel");

关于jquery - SimpleModal 不会为我关闭,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5586330/

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