Solved

Maximize pop up window from another site with JavaScript

Posted on 2004-08-05
5
1,870 Views
Last Modified: 2012-05-05
I have a link in my site and I want that, when it is clicked, opens a new pop up window maximized (with for example http://www.anothersite.com/, not with a page that is hosted in my web). Because it is hosted in another site, I cannot use something like this (I cannot edit that page because it's in other site):

<script language="JavaScript1.2">
<!--
top.window.moveTo(0,0);
if (document.all) {
top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
//-->
</script>

I would like that the page "maximizes" to highest resolution available , no matter if the user has 800x600 or 1024x768 or another....
I don't know if it's possible to maximize, or only simulates this, resizing the window to these measures.
Thank you very much for your help. ;)
0
Comment
Question by:DeLaVegaz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 36

Accepted Solution

by:
Zyloch earned 38 total points
ID: 11730073
Hi

Use window.open:

var width=500;
var height=300;
if (screen) {
   width = screen.width;
   height = screen.height;
}
window.open(URL,NAME,'width='+width+',height='+height);


If you want it totally full screen, though, in IE, you can do this:

window.open(URL,NAME,'fullscreen=yes');

Regards,
Zyloch
0
 
LVL 33

Assisted Solution

by:knightEknight
knightEknight earned 37 total points
ID: 11730086
create a local page (on your website) that opens the window and sizes it, then redirect it to the other site:

<HTML>
<HEAD>
<script language="JavaScript1.2">
<!--
top.window.moveTo(0,0);
if (document.all) {
  top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById) {
  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
     top.window.outerHeight = screen.availHeight;
     top.window.outerWidth = screen.availWidth;
  }
}

location = "http://www.otherdomain.com/othersite.html";

//-->
</script>
</HEAD>
</HTML>
0
 
LVL 18

Expert Comment

by:arantius
ID: 11732163
Don't do it.  Users do not enjoy it.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question