how to change parent window when modal Window is open
Posted: Fri Apr 10, 2009 1:33 am
hi,
i want to change parent window while modal Window opening or opened
my php code is
while click on title above will open modal window ,now i want to change parent window.
javascript code
pls help
i want to change parent window while modal Window opening or opened
my php code is
Code: Select all
<li>
<div class='newsPopUpModal'>
<a href='#' onmouseover=JT_show('".base_url().index_page()."interest/show_news_detail."/".$detail_val['file_name'].") onmouseout='removetip();' class='jTip' id='".$detail_val['tip_id']."' onclick=openMyModal('".$detail_val['title_link']."','".base_url().index_page()."interest/".$interest_id.$arr_detail_val[0]['file_name']."');>".$detail_val['title']."
</a>
</div>
</li>";
javascript code
Code: Select all
var modalWindow = {
parent:"body",
windowId:null,
content:null,
width:null,
height:null,
close:function(pagesource)
{ window.location = pagesource;
$(".modal-window").remove();
$(".modal-overlay").remove();
},
open:function(pagesource)
{ //alert(pagesource);
var modal = "";
modal += "<div class=\"modal-overlay\"></div>";
modal += "<div id=\"" + this.windowId + "\" class=\"modal-window\" style=\"width:" + this.width + "px; height:" + this.height + "px; margin-top:- 0px; margin-left:- 0px;\">";
modal += this.content;
modal += "</div>";
$(this.parent).append(modal);
// window.opener.location.href = pagesource;
$(".modal-window").append("<a class=\"close-window\"></a>");
$(".close-window").click(function(){modalWindow.close(pagesource);});
$(".modal-overlay").click(function(){modalWindow.close();});
}
};
var openMyModal = function(source,pagesource)
{
modalWindow.windowId = "myModal";
modalWindow.width = 900;
modalWindow.height = 550;
modalWindow.content = "<iframe width='900' height='550' frameborder='0' scrolling='yes' allowtransparency='true' src='" + source + "'></iframe>";
modalWindow.open(pagesource);
};