/    Sign up×
Community /Pin to ProfileBookmark

Pop-up at center of page

Hi everybody,
I’ve made a pop-up for a web page when it loads, but a would like it to appear at the center of the page, not in a corner. Can somebody help me? I’m sure it’s a simple question… Thanks!

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@cootheadDec 16.2004 — Hi there cali2copi

and a warm welcome to these forums ?

Try this...
[color=navy]<script type="text/javascript">
<!--

var w=500; /* popup window width*/
var h=440; /* popup window height*/

var l=(screen.width-w)/2; /*this centers horizontally*/
var t=(screen.height-h)/2; /*this centers vertically*/

var url="http://www.google.com";

var features="left="+l+",top="+t+",width="+w+",height="+h+",scrollbars=auto";

function popItUp() {
window.open(url,"",features);
}

//-->
</script>

<a href="javascript:void(popItUp())">google</a>[/color]


[i]coothead[/i]
Copy linkTweet thisAlerts:
@Stephen_PhilbinDec 16.2004 — Or you might even prefer to use this:

<i>
</i>



It's a great alternative.
×

Success!

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