Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Full screen open and close

Status
Not open for further replies.

marcela24

Programmer
Joined
Feb 17, 2003
Messages
72
Location
NL
I'm using this function to open a window in full screen mode and then to close it when its already in full screen.

function fullwin()
{
if (this.name!='fullscreen'){
window.open("central.asp","","fullscreen,scrollbars")
}
else
{
window.close(self)
}
}

The problem is that this code always do the "if", it never does the "else".
Of course there's a problem in this.name, but i don't know what's wrong cause iam newbie in Java Script. Could you help me?
 
in this context, "this" would refer to the window object, so the else code would only execute if the window had been named "fullscreen"

how are you intending this to work? is the user clicking a button to close the window?

or if you want the window to "fix" itself to fullscreen, maybe this is what you're looking for:

if (this.name != "fullscreen") {
window.open(location.pathname,"fullscreen", "fullscreen,scrollbars");
window.opener = self;
window.close();
}
=========================================================
while (!succeed) try();
-jeff
 
Actually i have a button in the page that do both the things, open in full screen and close the full screen.
When i first loads the page it is in normal size, than the user could click in a button to open the window in full screen and then he could also clik inthis same button to close the full screen window. The button calls the function iam trying to do in the click event.
 
then it looks like all you need to do is name the new window:

function fullwin()
{
if (this.name!='fullscreen'){
window.open("central.asp","fullscreen","fullscreen,scrollbars")
}
else
{
window.close(self)
}
}

=========================================================
while (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top