按钮点击关闭jQuery thickbox [英] Close jQuery thickbox on button click

查看:83
本文介绍了按钮点击关闭jQuery thickbox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的jQuery:

Here is my jQuery:

<script src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/thickbox.js"></script>
<script type="text/javascript"

$('#button').click(function(){
     $('#TB_window').fadeOut();
});

</script>

Html:

  <input type="submit" id="button" value="clse" >

我尝试过这个功能,但它不起作用。

I tried this function, but it's not working.

推荐答案

Thickbox有自己的内置方法。 tb_remove 只需在任何需要的地方调用此方法 tb_remove(); 。它会正确关闭厚箱。

Thickbox have their built in method. tb_remove just call this method tb_remove(); wherever you need. It will close thickbox properly.

如果您使用 $('#TB_window')。fadeOut(); ,TB_overlay DIV将保持打开状态。如果你再次做一些废话,比如 $('#TB_overlay')。fadeOut(); 那么它会给你的厚箱带来问题。而thickbox将停止运作。

If you use $('#TB_window').fadeOut(); , TB_overlay DIV will remain open. If you again do something nonsense like $('#TB_overlay').fadeOut(); then it will create problem for your thickbox. And thickbox will stop function.

这篇关于按钮点击关闭jQuery thickbox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆