/    Sign up×
Community /Pin to ProfileBookmark

Window Resizing Problem

Ok guys this is a script i tried to run on my site however it doesnt work … The purpose of the script is to maximize the window if it isn’t already maximized or to reset the size to a set measurement as seen in the code

[code]
function resize(){

if ( window.height == screen.height ) {
top.window.resizeTo ( Math.ceil( “800” ) , Math.ceil( “600” ) );
top.window.moveTo ( Math.ceil( “50” ) , Math.ceil( “50” ) );
} else {
top.window.resizeTo ( Math.ceil( screen.width ) , Math.ceil( screen.height ) );
top.window.moveTo ( Math.ceil( “0” ) , Math.ceil( “0” ) );
}
}
[/code]

Another fact is that the window was opened by script:

[code]
window.open(“full.htm”, “”, “fullscreen=1,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0”);
[/code]

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Apr 27.2003 — in your window.opne properties,you have this attribute with value

fullscreen=1

it forces IE to open a window taking up whole screen.once its full screen its not allowing it to resize( it seems like it).

use fullscreen=0 and here is updated version of your resize function

function resize(){

if ( document.body.offsetHeight == screen.height ) {

top.window.resizeTo ( Math.ceil( 800 ) , Math.ceil( 600 ) );

top.window.moveTo ( Math.ceil( 50 ) , Math.ceil( 50 ) );

} else {

top.window.resizeTo ( Math.ceil( screen.width ) , Math.ceil( screen.height )+25 );

top.window.moveTo ( Math.ceil( 0 ) , Math.ceil( 0 ) );

}

}

I have tested bove with IE6+
Copy linkTweet thisAlerts:
@hysauthorApr 27.2003 — How do you get the return value of the window's height...

I used:

<i>
</i>alert (window.height);


and it returned undefined
Copy linkTweet thisAlerts:
@pyroApr 27.2003 — You can get it in NN with window.outerHeight. Not sure what the IE way to do this would be, if there even is one...
Copy linkTweet thisAlerts:
@hysauthorApr 27.2003 — [i]Originally posted by Dave Clark [/i]

[B]



So, for IE, you are only told the inner dimensions of the client viewing area:



document.body.offsetWidth

document.body.offsetHeight



[b]Dave[/b] [/B]
[/QUOTE]


But does that only give the height of the document not the window... Because the document is in a frameset...
Copy linkTweet thisAlerts:
@hysauthorApr 28.2003 — I have tested your script Dave and it works fine but a question:

I've tried to put it into a frame then i modified your script and realise there is a slight difference between

top.document.body.offsetHeight and document.body.offsetHeight

to preview this difference you may be required to put the script into frames.
Copy linkTweet thisAlerts:
@hysauthorApr 29.2003 — Hello Guys,

I have achieved my objectives using top.document.body.offsetHeight.

The output can be viewed at:

http://offers.www4.dotnetplayground.com


however at the moment this has only been tested on IE 5.5 and 6... in addition on Windows 2000 and XP machines with 1024 x 768 resolution....
×

Success!

Help @hys spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...