/    Sign up×
Community /Pin to ProfileBookmark

Weird error: please help (pixel discrepancy between window.resizeTo and window.open)

im very confused, on one page for a site i am creating i have this code

[CODE]<script language=”JavaScript”>
<!–
function MM_openBrWindow(theURL,winName,features) {
window.open(theURL,winName,features);
}
//–>
</script>[/CODE]

in the <head> section, which is called by this link

[CODE]<a href=”#” onClick=”MM_openBrWindow(‘main.aspx’,’main’,’resizable=no,scrollbars=no,toolbar=no,location=no,directories=no,status=yes,menubar=no,copyhistory=no,[B]width=820,height=644[/B]’)” STYLE=”TEXT-DECORATION: NONE”>click here</a>
[/CODE]

on the newly loaded page i have the following

[CODE]<head>
<script language=”JavaScript”>
<!–
function resizeFunc()
{
window.resizeTo([B]width=825,height=697[/B]);
}
//–>
</script>
</head>
<body onresize=”resizeFunc()” onresizestart=”resizeFunc()”>
[/CODE]

whats confusing me is that the size measurements in the resizeTo function (825,697) end up resizing the window to the same size as it is when opened with (820,644). if i try to use (820,644) with the resizeTo function, part of the page is lost… can anyone tell me why this is happening?

thanks in advance.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@mrhooMay 25.2007 — window.resizeTo(825,697) is correct syntax but should be called from the scope of the opener, var newwin=window.open(); newwin.resizeTo();
Copy linkTweet thisAlerts:
@lowfauthorMay 26.2007 — cool didn't know that thanks... would that cause the pixel size discrepancy tho? also, how can i pass the variable reference from the page that created the window to the newly created window?

sorry i have not done much web development before. more of a c++ programmer.
×

Success!

Help @lowf 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...