This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript image pop up

 
Ferry Lukito
Greenhorn
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, the suggestion works well. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic