<script language="javascript" type="text/javascript">
function popWin(file){
newWin=window.open("","ResizeBillede","width=300,height=200,status=no");
txt='<ht'+'ml><he'+'ad><ti'+'tle>Resize til billede<\57ti'+'tle><scri';
txt+='pt language="javascript" type="text/javascript">';
txt+='function resPic(){h=document.images[0].scrollHeight;';
txt+='w=document.images[0].scrollWidth;window.resizeTo(w+6,h+32);}<\57scri';
txt+='pt><\57he'+'ad><bo'+'dy style="overflow:hidden;';
txt+='border:0px;margin:0px"><i'+'mg src="'+file+'" style="top:0px;left:0px;border:0px;';
txt+='" onload="resPic();" onclick="window.close()"><\57bo'+'dy><\57ht'+'ml>';
newWin.document.write(txt);
newWin.document.close();
}
</script>
og din kode:
print "<a href=\"
http://x.dk/365/upload/".$row["name"]."\" onclick=\"popWin('
http://x.dk/365/upload/".$row["name"]."');return false\"><img src=upload/".$row["name"]." width=\"97\" border=\"0\" height=\"97\" alt=\"".$row["dato"]." ".$row["tid"]."\"></img></a>";