Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-10-2003, 12:31 PM   PM User | #1
dysfunctionGazz
Regular Coder

 
Join Date: Jul 2002
Location: Brighton
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
dysfunctionGazz is an unknown quantity at this point
linking directly to a .jpg file

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
dysfunctionGazz is offline   Reply With Quote
Old 01-10-2003, 12:48 PM   PM User | #2
bfsog
Regular Coder

 
Join Date: Dec 2002
Location: UK
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
bfsog is an unknown quantity at this point
Sorry

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
bfsog is offline   Reply With Quote
Old 01-10-2003, 12:50 PM   PM User | #3
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
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
brothercake is offline   Reply With Quote
Old 01-10-2003, 12:55 PM   PM User | #4
dysfunctionGazz
Regular Coder

 
Join Date: Jul 2002
Location: Brighton
Posts: 180
Thanks: 0
Thanked 0 Times in 0 Posts
dysfunctionGazz is an unknown quantity at this point
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

dysfunctionGazz is offline   Reply With Quote
Old 01-10-2003, 03:54 PM   PM User | #5
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
something like

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

var picWin = open('','picWin','width='+(imgW+20)+',height='+(imgH+20)+',scrolling=no,status=yes,toolbars=no,menubar=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>
brothercake is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:13 PM.


Advertisement
Log in to turn off these ads.