View Full Version : linking directly to a .jpg file

01-10-2003, 01:31 PM
on my website photo gallery I employ the standard technique of thumbnails linking direct to the file, which then just opens in a new browser window on plain white background.

is there a way i can maybe change the style of the default target="_blank"....?

im wondering if I can cheat so that the browser window might show a different default background color around the .jpg.

Can any code do this...? I still want to link direct to the files coz i dont want to have to code loads of extra html pages to embed the photos in.


01-10-2003, 01:48 PM
My take on this... other than having a color behind your image, there is no way (that I can think of) of having what you have asked.

Sorry, but theres still hope, mebbe some other guys will know

01-10-2003, 01:50 PM
Open a window and write into it

newWin = open( ... etc

newWin.document.write("<html> .... etc

You can reuse the same code inifinitely by passing parameters for the image src, bgcolor, or whatever

01-10-2003, 01:55 PM
thanks brothercake....

I get wot ur saying...

Could u please help by demonstrating on the below example how it would work...

<A href="images/nuyear44.jpg" target="_blank"><IMG src="thumbnails/nuyear44.jpg" border="0" alt="nuyear44"></A>

The above will open the pic direct... im not sure how i can make it work how u say for all the different pics, there are around 200


01-10-2003, 04:54 PM
something like

function pictureWindow(imgSrc,imgW,imgH,imgName) {

var picWin = open('','picWin','width='+(imgW+20)+',height='+(imgH+20)+',scrolling=no,status=yes,toolbars=no,menub ar=no');

var htm='';
htm+='<body bgcolor="pink"><img src="'+imgSrc+'" width="'+imgW+'" height="'+imgH+'" alt="'+imgName+'"></body></html>';



Then you call it like

<a href="javascript:pictureWindow("image.jpg",200,250,"My Picture")>Click her to open this picture</a>