Hvorfor åbner den kun 1 gang??
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<script>
var winw = "400"; //############# How wide should your window be (pixels)
var winh = "300"; //############# How tall should the window be (pixels)
var repeat = "5"; //Do you want visitor to be able to re-open window after closing?
var ie=(document.all);
var ns=(document.layers);
var ns6=(document.getElementById && !ie);
var calculate=ns? "" : "px"
function loadElement(){
if(!ns && !ie && !ns6) return;
if(ie) popup=eval('document.all.elementDiv.style');
else if(ns) popup=eval('document.layers["elementDiv"]');
else if(ns6) popup=eval('document.getElementById("elementDiv").style');
if (ie||ns6) popup.visibility="visible";
else popup.visibility ="show";
displayElement()
}
function displayElement(){
var agent=navigator.userAgent.toLowerCase();
if (ie){
documentWidth = (centerElement().offsetWidth)/2+centerElement().scrollLeft-(winw/2);
documentHeight = (centerElement().offsetHeight)/2+centerElement().scrollTop-(winh/2);
}
else if (ns){
documentWidth=window.innerWidth/2+window.pageXOffset-(winw/2);
documentHeight=window.innerHeight/2+window.pageYOffset-(winh/2);
}
else if (ns6){
documentWidth=self.innerWidth/2+window.pageXOffset-(winw/2);
documentHeight=self.innerHeight/2+window.pageYOffset-(winh/2);
}
popup.left = documentWidth+calculate;
popup.top = documentHeight+calculate;
}
function centerElement(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function closeElement(){
if (ie||ns6) { popup.display="none"; }
else { popup.visibility ="hide"; }
if (repeat == 1) { location.replace; }
}
</script>
</head>
<body>
<script>
document.write('<table cellSpacing="0" cellPadding="10" border="0" bgcolor="gray" width='+winw+' height='+winh+' id="elementDiv" style="visibility:hidden; position:absolute; top:0; left:0">');
</script>
<tr>
<td align="left" valign="top" bgcolor="blue" width="100%" height="10px">TITEL</td>
<td width="10px" height="10px" bgcolor="red" align="right"><span onclick="closeElement()" title="Click here to close this window">X</span></td>
<script>
document.write('</tr><tr>');
</script>
<td colspan="2">Indhold...</td>
<script>
document.write('</tr></table>');
</script>
Åben popup <a onclick="loadElement()">her</a>
</body>
</html>