/    Sign up×
Community /Pin to ProfileBookmark

Equally distribute 4 browsers on screen?

Hello,

I’m trying to create 4 browser-windows that pop-up and equally distribute on the user’s screen. (Like a 2×2 grid)

Til now I have this code:

[CODE]<script>
<!–
function wopen()
{

w = screen.width / 2;
h = screen.height / 2;

var win1 = window.open(“url.html”,”window1″, “height=”+ h +”, width=”+w+”, left=0, top=0, toolbar=no, status=no, menubar=no, location=no”);
var win2 = window.open(“url.html”,”window2″, “height=”+ h +”, width=”+w+”, left=”+screen.width / 2+”, top=0, toolbar=no, status=no, menubar=no, location=no”);
var win3 = window.open(“url.html”,”window3″, “height=”+ h +”, width=”+w+”, left=0, top=”+screen.height / 2+”, toolbar=no, status=no, menubar=no, location=no”);
var win4 = window.open(“url.html”,”window4″, “height=”+ h +”, width=”+w+”, left=”+screen.width / 2+”, top=”+screen.height / 2+”, toolbar=no, status=no, menubar=no, location=no”);

win1.focus();
win2.focus();
win3.focus();
win4.focus();
}
// –>
</script>[/CODE]

It works quite well. The problem is that browsers overlap because they have the window-bars on top and the user has the tool-bar of the operating system aswell. So I guess that screen.size gives the whole screen’s size and that’s why the browsers including the window-bars are too big.

Does anyone know a good solution to nicely fit those browser-windows on the screen?

Thanks!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@007JulienFeb 06.2012 — Ask the user to choose full screen or to mask the window-bar ? I do not find other methods on this page.
×

Success!

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