12-12-2001, 07:48 PM
|
#1
|
|
uhhhh... I forgot.
Join Date: Nov 2001
Location: Caracas - Venezuela
Posts: 128
|
Problem opening a new window from a popup window
Hello fellas, I was reading the posts about popup windows and spawn windowns and no one fix my problem.
now what is the thing that has made this post to accur.
I have a flash movie opened in a popup window, now from the swf file I want to open a new browser window(Popup too) with some other stuff.
my code to popup the main movie:
Code:
<script language="javascript">
<!--
function PopupWin(page,IEWidth,IEHeight,NNWidth,NNHeight) {
var MyBrowser = navigator.appName;
if (MyBrowser == "Netscape") {
var myWinWidth = (window.screen.width/2) - (NNWidth/2);
var myWinHeight = (window.screen.height/2) - ((NNHeight/2) + 50);
var myWin = window.open(page,"MainWin","width=" + NNWidth + ",height=" + NNHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resizable=0,titlebar=no");
}
else {
var myWinWidth = (window.screen.width/2) - (IEWidth/2);
var myWinHeight = (window.screen.height/2) - ((IEHeight/2) + 50);
var myWin = window.open(page,"MainWin","width=" + IEWidth + ",height=" + IEHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resizable=0,titlebar=no");
}
myWin.focus();
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
and from the page that is open i will have to call another html pages and the code remains the same just change the function from PopupWin to PopupWin2
and nothing happens it still load in the same window and that DOESNT HAVE TO HAPPEN because you know
Please help.
maybe there is any way to set up that javasctipt to open in a
Code:
getURL("javascript:PopupWin2('........')","_blank");
or something.
|
|
|
12-12-2001, 07:56 PM
|
#2
|
|
uhhhh... I forgot.
Join Date: Nov 2001
Location: Caracas - Venezuela
Posts: 128
|
by the way...
I have tested that about ","_blank"); and doesnt work.
This reply is to share with all of you that the code opens the popup window centered in the monitor no matter wich resolution the visitor have.
Ir is great.
Please help ASAP.
Greets,
|
|
|
12-12-2001, 08:15 PM
|
#3
|
|
uhhhh... I forgot.
Join Date: Nov 2001
Location: Caracas - Venezuela
Posts: 128
|
I fond it myself...
Thanks anyway.
The problem was here.
Remember the code???
Code:
<script language="javascript">
<!--
function PopupWin(page,IEWidth,IEHeight,NNWidth,NNHeight) {
var MyBrowser = navigator.appName;
if (MyBrowser == "Netscape") {
var myWinWidth = (window.screen.width/2) - (NNWidth/2);
var myWinHeight = (window.screen.height/2) - ((NNHeight/2) + 50);
var myWin = window.open(page,"MainWin ","width=" + NNWidth + ",height=" + NNHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resizable=0,titlebar=no");
}
else {
var myWinWidth = (window.screen.width/2) - (IEWidth/2);
var myWinHeight = (window.screen.height/2) - ((IEHeight/2) + 50);
var myWin = window.open(page,"MainWin ","width=" + IEWidth + ",height=" + IEHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resizable=0,titlebar=no");
}
myWin.focus();
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
take a look at the feature where the name of the window is set.
well it have to be changed, if no the browser will asume that you are oppening the new html file in the same window.
Enjoy the code and use it people its verry nice to open the popup windows centered.
Greets,
|
|
|
12-12-2001, 08:16 PM
|
#4
|
|
uhhhh... I forgot.
Join Date: Nov 2001
Location: Caracas - Venezuela
Posts: 128
|
I fond it myself...
Thanks anyway.
The problem was here.
Remember the code???
Code:
<script language="javascript">
<!--
function PopupWin(page,IEWidth,IEHeight,NNWidth,NNHeight) {
var MyBrowser = navigator.appName;
if (MyBrowser == "Netscape") {
var myWinWidth = (window.screen.width/2) - (NNWidth/2);
var myWinHeight = (window.screen.height/2) - ((NNHeight/2) + 50);
var myWin = window.open(page,"MainWin ","width=" + NNWidth + ",height=" + NNHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resizable=0,titlebar=no");
}
else {
var myWinWidth = (window.screen.width/2) - (IEWidth/2);
var myWinHeight = (window.screen.height/2) - ((IEHeight/2) + 50);
var myWin = window.open(page,"MainWin ","width=" + IEWidth + ",height=" + IEHeight + ",screenX=" + myWinWidth + ",screenY=" + myWinHeight + ",left=" + myWinWidth + ",top=" + myWinHeight + ",scrollbars=yes,toolbar=0,status=1,menubar=0,resizable=0,titlebar=no");
}
myWin.focus();
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
take a look at the feature where the name of the window is set.
well it have to be changed could be something like MainWin2, if no the browser will asume that you are oppening the new html file in the same window.
Enjoy the code and use it people its verry nice to open the popup windows centered.
Greets,
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 12:08 AM.
///
|
|