Jump to content

how to change parent window when modal Window is open


uday M

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.