Skip to main content
Known Participant
June 1, 2008
Question

Javascript Pop-up window

  • June 1, 2008
  • 1 reply
  • 481 views
Hello guys. PLEASE HELP ME!
I have the Javascript for opening a page into a pop up window with no toolbars, scrollers etc….
Here is the code that I enter in the html page itself in the HEAD tags:
</style></head>
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>

Here is the code that I enter into a button from the flash movie:
on (release) {
getURL("\r\njavascript:openNewWindow('main.html','thewin',\\r\\n'width=1280,height=980,toolbar=no,scrollbars=yes')");
}

What I am looking for is that I need the popup window to open not by specifying WIDTH and HEIGHT as above in my script, but I would like the html to extend and open on a percentage way thus to fit any monitor.
I tried this but it wasn’t working:
'width=100%,height=100%
Or
'width=default, height=default

I hope someone has the clue for me regarding this issue.

Thanks a lot for your efforts,

Beko
This topic has been closed for replies.

1 reply

Inspiring
June 2, 2008
Beko,
I guess you should not provide width and height as 100% instead you can set fullscreen parameter as yes in javascript which will open new window in fullscreen mode.




Thanks & Regards
Ankur Arora
Project Leader(Flash and Flex)
http://flashdeveloper.blogspot.com
let your thoughts fly to others... you will become rich.

beko75Author
Known Participant
June 2, 2008
Hey Ankur Arora :)

I graetly appreciate your reply. Thanks so much. Is it possible for you to let me know what would the original Javascript be for the Fullscreen option?

Thanks and hope you will be helpful.

Respectfully yours,
Beko
Inspiring
June 3, 2008
Here you go....

<script type="text/javascript">
<!--
function popup(url)
{
params += ', directories=no';
params += ', location=no';
params += ', menubar=no';
params += ', resizable=no';
params += ', scrollbars=no';
params += ', status=no';
params += ', toolbar=no';
params += ', fullscreen=yes';
newwin=window.open(url,'windowname', params);
if (window.focus) {newwin.focus()}
return false;
}
// -->
</script>

<a href="javascript: void(0)" onclick="popup('popup.html')">Fullscreen popup window</a>






Thanks & Regards
Ankur Arora
Project Leader(Flash and Flex)
http://flashdeveloper.blogspot.com
let your thoughts fly to others... you will become rich.