当ThinBox关闭时,您将如何触发事件? [英] How would you trigger an event when a ThickBox closes?
本文介绍了当ThinBox关闭时,您将如何触发事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
此问题与Wordpress半相关,但在其他地方也有应用.基本上,我正在尝试做到这一点,以便当有人退出Thickbox时,它会触发页面上其他位置的事件.不能编辑Thinbox文件.
This question is Semi-related to Wordpress, but has applications elsewhere. Basically, I'm trying to make it so when someone exits out of a Thickbox, it triggers an event elsewhere on the page. Editting the Thickbox file isn't an option.
推荐答案
这有点复杂,因为Thinbox并不是这样写的.但是也许您可以使用一些技巧来做到这一点.
It's a bit complicated since Thickbox isn't written that way. But maybe you can use some tricks to do it.
这不是推荐的解决方案,但是您可以重写"关闭功能.像这样:
It's not the recommended solution but you can "rewrite" the close function. Something like:
var old_tb_remove = window.tb_remove;
var tb_remove = function() {
old_tb_remove(); // calls the tb_remove() of the Thickbox plugin
alert('ohai');
};
Works \ o/ http://jsfiddle.net/8q2JK/1/
Works \o/ http://jsfiddle.net/8q2JK/1/
这篇关于当ThinBox关闭时,您将如何触发事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文