uday M Posted April 10, 2009 Share Posted April 10, 2009 hi, i want to change parent window while modal Window opening or opened my php code is <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>"; while click on title above will open modal window ,now i want to change parent window. javascript code 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); }; pls help Link to comment https://forums.phpfreaks.com/topic/153434-how-to-change-parent-window-when-modal-window-is-open/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.