aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes javascript image pop up Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript image pop up" Watch "javascript image pop up" New topic
Author

javascript image pop up

Ferry Lukito
Greenhorn

Joined: Dec 13, 2004
Posts: 8
hi guys, I'm a newbie in javasript and would like to get some help. I need a javascript that allows me to view image in a pop up window. I have a main window that has all the thumbnail of the pictures. When users click on any of the pictures, there will be a pop up window appears, with the enlarged picture of the selected picture and I would also like to allow user to click on "Next" and "Back" button on the pop up window to browse through the next and previous button. Anyone can help me on this? Thanks b4...
Bajji Pat
Ranch Hand

Joined: Apr 05, 2005
Posts: 50
Hi,

The following code works fine in I.E (plz test in whatever browser u need to support)
[CODE]

function opnImg(imgname)
{
// Since the WINDOW NAME is the same
// Each picture would open in the same window
// Hence the back and forward button can be used(unless the window
// is closed each time)
window.open(imgname,"WINDOWNAME");
}

Have your thumbnail pictures in the "body" tag
use the onclick attribute as below :
Use the following attribute in your "img" tag

"onClick" attributes value -javascript pnImg('yourimagename.jpg');


Hope this helps
Regards
Balaji
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There a bunch of slideshows here that you may find useful.

http://www.javascriptkit.com/script/cutindex21.shtml
http://dynamicdrive.com/dynamicindex14/index.html

Eric
Ferry Lukito
Greenhorn

Joined: Dec 13, 2004
Posts: 8
Yeah, the suggestion works well. Thanks.
 
Don't get me started about those stupid light bulbs.
 
subject: javascript image pop up