• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javascript image pop up

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, the suggestion works well. Thanks.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic