Image Popup

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Image Popup

Post by LiveFree »

Hey Ya'll!

I have a gallery with a very narrow main frame design so I cant show the picture without ruining the layout..

So basically what Im looking for is a JavaScript code I can add to my script so that when I click on a thumbnail, the full image is displayed in a popup

Thanks :)
foobar
Forum Regular
Posts: 613
Joined: Wed Sep 28, 2005 10:08 am

Re: Image Popup

Post by foobar »

matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

I cannot give you the code straight away, but I have some very good links:
http://adactio.com/articles/display.php ... t_model/11
http://www.huddletogether.com/projects/lightbox/
and I know Richardathome had an example of an unobtrusive popup script, but he recently changed domains to http://richardathome.wordpress.com/ so I'm not sure where his article is at the moment.
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post by LiveFree »

Okie

The Window.open worked ... but when I click on it the parent window goes blank and you can only see:

[object Window]

Thanks
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

If you follow the links I gave you'll see some perfectly working examples. Maybe you could look at them, use them or use parts of that code for your own script. Then if you encounter any problems, post your code here and I'm sure someone can help.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

You could make the link like this:

Code: Select all

<a href = "javascript:void(0);" onClick = "window.open('blah blah');">
You could also use the "target" attribute:

Code: Select all

<a href = "racecar.jpg" target = "_new">
This is probably the best way
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply