Hi everyone - a quick, and probably easy question:
I am implementing a pop up window and need it to be centered. Found this code (below) seems to work good. I need to open it with an image rather than text link. Can anyone provide the correct syntax for this, if say the image was called ‘test.jpg’? Thanks!
<script type=“text/javascript”>
<!–
function popup(url)
{
var width = 300;
var height = 200;
var left = (screen.width - width)/2;
var top = (screen.height - height)/2;
var params = ‘width=’+width+‘, height=’+height;
params += ‘, top=’+top+‘, left=’+left;
params += ‘, directories=no’;
params += ‘, location=no’;
params += ‘, menubar=no’;
params += ‘, resizable=no’;
params += ‘, scrollbars=no’;
params += ‘, status=no’;
params += ‘, toolbar=no’;
newwin=window.open(url,‘windowname5’, params);
if (window.focus) {newwin.focus()}
return false;
}
// –>
</script>
<a href=“javascript: void(0)”
onclick=“popup(‘popup.html’)”>Centered popup window</a>