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:
Code snippet 2...no clue where to put this:Code:<script language="javascript" type="text/javascript"> function PopupPic(sPicURL) { newWin=window.open( sPicURL, 'newWin', 'resizable=1,HEIGHT=200,WIDTH=200'); newWin.focus(); } </script>
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.Code:<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>
Any help would be greatly appreciated!



Reply With Quote



Bookmarks