epic1
Mon 30th May '05, 11:15pm
I've done over 20 searches, still cannot find how to do this.
I have my attachments open in a new window via target="_blank". That's all good and done.
I need the popup window to fit to the image's size. I have both scripts I need to use to do this, I just don't know how to go about putting them together in the correct manner via the template manager.
Code snippet 1 within Showthread template header:
<script language="javascript" type="text/javascript">
function PopupPic(sPicURL) {
newWin=window.open( sPicURL, 'newWin',
'resizable=1,HEIGHT=200,WIDTH=200');
newWin.focus();
}
</script>
Code snippet 2...no clue where to put this:
<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
var NS = (navigator.appName=="Netscape")?true:false;
function FitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight ;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight);
self.focus();
};
</script>
</head>
<body bgcolor="#000000" onload="FitPic();" topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<img src="$image&id=$id" border="0" alt="" />
</body>
</html>
It does open the attachment in a new 200x200 window, but it does not resize since I'm stumped on where to put the second code tidbit.
Any help would be greatly appreciated!
I have my attachments open in a new window via target="_blank". That's all good and done.
I need the popup window to fit to the image's size. I have both scripts I need to use to do this, I just don't know how to go about putting them together in the correct manner via the template manager.
Code snippet 1 within Showthread template header:
<script language="javascript" type="text/javascript">
function PopupPic(sPicURL) {
newWin=window.open( sPicURL, 'newWin',
'resizable=1,HEIGHT=200,WIDTH=200');
newWin.focus();
}
</script>
Code snippet 2...no clue where to put this:
<html>
<head>
<title></title>
<script language="javascript" type="text/javascript">
var NS = (navigator.appName=="Netscape")?true:false;
function FitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight ;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight);
self.focus();
};
</script>
</head>
<body bgcolor="#000000" onload="FitPic();" topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<img src="$image&id=$id" border="0" alt="" />
</body>
</html>
It does open the attachment in a new 200x200 window, but it does not resize since I'm stumped on where to put the second code tidbit.
Any help would be greatly appreciated!