/    Sign up×
Community /Pin to ProfileBookmark

Centering a Pop up!

does anyone know the javascript to add to
center my opo up window???

[url]http://www.nicothekitty.com[/url]
Thanks guys

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@CharlesFeb 24.2003 — [font=georgia]Like most all scripts from that site, that one has a few problems. Use instead:[/font]

[font=monospace]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta name="Content-Script-Type" content="text/javascript">

<title>Window Example</title>

<script type="text/javascript">

<!--

function newWin(url, height, width) {

if (navigator.appName == 'Opera') return true;

// the following will give unacceptable results in Opera running in "Multiple Document Interface" mode

var y = 0;

var x = Math.floor((screen.width - width) / 2);

var param = 'height=' + height;

param += ',width=' + width;

param += ',height=' + height;

param += ',screenX=' + x;

param += ',left=' + x;

param += ',screenY=' + y;

param += ',top=', + y;

window.open(url, 'child', param);

return false;

}

// -->

</script>

<p><a href="http://www.w3.org/" onclick="return newWin(this.href, 400, 300)">W3C</a></p>[/font]
×

Success!

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