Click to See Complete Forum and Search --> : what do i use and how do i do it?


Think Twice
02-24-2004, 09:28 PM
how could i write something for this situation:

I have a page with a lot of pictures on it, and i want to be able to click them and they open up in a different window, but, i don't want to have to have a whole lot of like: pic1.html, pic2.html, etc. So could i just have a page with the pictures, and then a page like, if you click *this* then it loads *this picture*??

PeOfEo
02-24-2004, 10:06 PM
<a href="img.jpg"> Just open the image in a link. Or you can do it server side and do a bunch of scripting and make an automated galery.

Think Twice
02-24-2004, 10:16 PM
oh lol i kinda forgot about that...haha. And could i just use some JS to make it open in like a window 200X300px with no scrollbar etc.?

PeOfEo
02-24-2004, 10:23 PM
yes you could. I prefer not to do things that way since it makes that content inaccessable, but you can make the image open in a new window by useing
<a href="imgrl" onclick="target='_blank';"><img></a>

buntine
02-24-2004, 10:23 PM
Yes, just a simple javaScript will achieve this.. The less glamarous way would be to use the 'target' parameter in the anchor element.


<a href="image.jpg" target="_blank"><img src="image_thumb.jpg" /></a>


Regards,
Andrew Buntine.

PeOfEo
02-24-2004, 10:25 PM
Originally posted by buntine
Yes, just a simple javaScript will achieve this.. The less glamarous way would be to use the 'target' parameter in the anchor element.


<a href="image.jpg" target="_blank"><img src="image_thumb.jpg" /></a>


Regards,
Andrew Buntine. I beat yah to it ;) . I use onclick="target='_blank';" though just because target is not valid html 4.01 strict or xhtml

Think Twice
02-24-2004, 10:33 PM
Originally posted by PeOfEo
yes you could. I prefer not to do things that way since it makes that content inaccessable, but you can make the image open in a new window by useing
<a href="imgrl" onclick="target='_blank';"><img></a>

what do youmean by inaccessable? i just want a window to come up that is the size of the picture, and there is no need for the people to scroll, so i'd probably take the scroll bar off

EDIT: oh and also, could i just make one universal code for all the pictures? or would i have to make oen for each link?

PeOfEo
02-24-2004, 10:39 PM
Javascript cannot be read by 13% of the internet according to current statistics on thecounter.com. If you make these things open with java script that 13% will not see your images. You can make a script that will open all of the images from a data base and all of that stuff with a server side language. This would be the way to go if you have tons and tons of images, but if its like 30 or so do it by hand.