admin管理员组文章数量:1416631
I'm using a ThickBox on a client's site to display a modal form. It's working well, except I can't get it to close. I'm sending modal=true so the title doesn't display, but I'm using divs as buttons to save information or close the box. From the examples I've seen I should be able to just call tb_remove() and that should take care of it, but it's not working at all.
<div style="clear: both;">
<div class="buttons" onclick="javascript:tb_remove()">
<h2>Cancel</h2>
</div>
<div class="buttons">
<h2>Save</h2>
</div>
</div>
I'm using a ThickBox on a client's site to display a modal form. It's working well, except I can't get it to close. I'm sending modal=true so the title doesn't display, but I'm using divs as buttons to save information or close the box. From the examples I've seen I should be able to just call tb_remove() and that should take care of it, but it's not working at all.
<div style="clear: both;">
<div class="buttons" onclick="javascript:tb_remove()">
<h2>Cancel</h2>
</div>
<div class="buttons">
<h2>Save</h2>
</div>
</div>
Share
Improve this question
asked Feb 6, 2012 at 18:43
CarlCarl
1,2763 gold badges23 silver badges41 bronze badges
1 Answer
Reset to default 4Are you getting any javascript errors? Check the console. Also, I would much rather write it like this:
HTML
<div id="wrap">
<div class="buttons">
<h2>Cancel</h2>
</div>
<div class="buttons">
<h2>Save</h2>
</div>
</div>
JAVASCRIPT
$(function() {
$('.buttons').click(function() {
tb_remove();
});
});
CSS
#wrap {clear:both;}
本文标签: javascriptClosing ThickBox Modal WindowStack Overflow
版权声明:本文标题:javascript - Closing ThickBox Modal Window - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745252398a2649900.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论