Home > Code Snippets, Web Design > jQuery Thickbox – Refresh parent when closing dialog

jQuery Thickbox – Refresh parent when closing dialog

This patch is for Thickbox 3.1

1. Open the non-compressed version of thickbox.js

2. Find function tb_remove(). This will be line# 268 if you have correct version

3. Add parent.location.reload(1); above return false; statement.

4. Done.

The code will look like this:

function tb_remove() {
 	$("#TB_imageOff").unbind("click");
	$("#TB_closeWindowButton").unbind("click");
	$("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
	$("#TB_load").remove();
	if (typeof document.body.style.maxHeight == "undefined") {//if IE 6
		$("body","html").css({height: "auto", width: "auto"});
		$("html").css("overflow","");
	}
	document.onkeydown = "";
	document.onkeyup = "";
 
    parent.location.reload(1); // Patch - Newly added line
 
    return false;
}
VN:F [1.9.18_1163]
Rating: 5.0/5 (3 votes cast)
jQuery Thickbox - Refresh parent when closing dialog, 5.0 out of 5 based on 3 ratings

No related posts.

Categories: Code Snippets, Web Design