dysfunctionGazz
01-10-2003, 12: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.
Thanks
Gazz
bfsog
01-10-2003, 12: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
brothercake
01-10-2003, 12: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
dysfunctionGazz
01-10-2003, 12: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
:)
brothercake
01-10-2003, 03: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+='<html><head><title>'+imgName+'</title></head>';
htm+='<body bgcolor="pink"><img src="'+imgSrc+'" width="'+imgW+'" height="'+imgH+'" alt="'+imgName+'"></body></html>';
picWin.document.write(htm);
}
Then you call it like
<a href="javascript:pictureWindow("image.jpg",200,250,"My Picture")>Click her to open this picture</a>