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; }
No related posts.
Categories: Code Snippets, Web Design
Recent Comments