/    Sign up×
Community /Pin to ProfileBookmark

What’s Missing in this simple code

I want to open a window to a specific size – the code works fine.
But any subsequent window opens to the same size.
How do I prevent that so that following pages open to their intended size.

<script LANGUAGE=”javascript”>
<!– defines size of window –>
function ScreenSize(w,h){
window.resizeTo(w,h);
}
</script>

<body onload=”javascript:void window.ScreenSize(600,900); “>

Thanks
[I]-Sandy[/I]

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@rtretheweyFeb 16.2012 — Try:
<i>
</i>&lt;body onload="ScreenSize(600,900); "&gt;


..but I would urge you to reconsider this technique. Resizing the user's browser is pretty rude, especially in these days where users often have many tabs open. And the unusual dimensions you've selected mean they'll likely have to manually resize their browser once they leave your site. Consider making your layout adjust to the user's current browser size automatically instead. Good luck!
Copy linkTweet thisAlerts:
@motuitiauthorFeb 16.2012 — I Didn't want to resize a users browser. I just want to size a pop up on[B] my page [/B]which seems to stick to that size on the next following page until dragged open. Maybe I didn't make myself clear.

I try your suggestion

Thanks

[I]-Sandy[/I]
×

Success!

Help @motuiti 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,
)...