/    Sign up×
Community /Pin to ProfileBookmark

Dreamweaver popup configuration

hey folks. i have the following code on my page to make a popup appear.

[code]
<html>

<head>
<script language=”JavaScript”>
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
</head>

<body onLoad=”MM_openBrWindow(‘popup.html’,”,’width=150,height=195′)”>

content of loveliness

</body>

</html>[/code]

This all works wonderfully well, but I was wondering if anyone knows a way to make the popup appear in a specific position, so 274 on the [i]Y[/i] axis and 654 on the [i]X[/i] axis.

It’s a macromedia function, so I’m not sure if there’s an easy way to modify /add to it.

Many thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@buntineJan 28.2004 — This is simple so achieve. You just have to alter the 'top' and 'left' parameters.

HTML code:
[CODE]
<a href="somepage.html" onclick="return openpage(this.href,'new_win',300,400);">Open window</a>
[/CODE]

or
[CODE]
<body onload="return openpage('somepage.html','new_win',300,400);">
[/CODE]


javaScript code:
[CODE]
function openpage(pageHref,pageName,pageWidth,pageHeight) {
// var pos_t=(screen.height - pageHeight) / 2;
// var pos_l=(screen.width - pageWidth) / 2;
var pos_t = 50; //Y axis
var pos_l = 100; //X axis
props='height=' +pageHeight+' ,width=' +pageWidth+' ,top=' +pos_t+' ,left=' +pos_l+' ,scrollbars=yes ,noresize';
show=window.open(pageHref, pageName, props);
show.window.focus();
return false;
}
[/CODE]


Note, if you would like the popup to open up directly in the center of the srceen then simply swap the commented lines.

Regards,

Andrew Buntine.
Copy linkTweet thisAlerts:
@hammerslaneauthorJan 28.2004 — thanks buntine! works great ?
×

Success!

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