Dragons0001 said:
I have added a behaviour to a graphic which when clicked on opens a
new window however the window always opens at the very top of the
screen. can i position the new window in the centre of the screen.
Try this
<a href="nojsmess.html" target="_self"
onclick="spawnJimcoPopup
('dayborn.html','',
'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no',
'180','200', 'center','center','pixel');return false;"
title="Want to know what day you were born?">
<img src="images/display/question.gif"
alt="" title="Want to know what day you were born?" height="24"
/>Day of your birth?</a><br />
The function is
function spawnJimcoPopup(url, name, options, h, w, x, y, scaleType)
{
var newWindow
if (scaleType == 'percent')
{ h = (h * screen.availHeight) / 100
w = (w * screen.availWidth) / 100 }
if (x == 'center')
x = (screen.availWidth - w) / 2
if (y == 'center')
y = (screen.availHeight - h) / 2
options += ',width=' + w + ',height=' + h
+ ',left=' + x + ',top=' + y
newWindow = window.open(url, name, options)
newWindow.focus()
}