next / previous image swap WITH larger image popup

C

Clay

Very simply what I need to do is almost identical to what you see here:

http://www.java-scripts.net/javascripts/Slide-Show-Script.phtml

(scroll down to the animal pictures)

When you click "next" and "previous" the images swap through a series
called "img1.gif" "img2.gif" and "img3.gif"

So far so good. However let us assume there is also a set of images called

"img1_lrg.gif" "img2_lrg.gif" and "img3_lrg.gif" which are larger
versions of those little thumbnails. I need for the appropriate associated
large image to popup in its own window when the thumb is clicked.

Has anyone a lead on something like that?

Thanks very much.
 
E

Elegie

Clay said:
When you click "next" and "previous" the images swap through a series
called "img1.gif" "img2.gif" and "img3.gif"

So far so good. However let us assume there is also a set of images called
"img1_lrg.gif" "img2_lrg.gif" and "img3_lrg.gif" which are larger
versions of those little thumbnails. I need for the appropriate associated
large image to popup in its own window when the thumb is clicked.

Add an ONCLICK attribute in the IMG tag, such as

<img ... onclick="foo(this)">

And then define the appropriate function :

---
function foo(img){
if(window.open){
window.open(
img.src.substr(0,img.src.lastIndexOf("."))+
"_lrg.gif","LargeImageArea"
);
}
}
---

<URL:http://jibbering.com/faq/#FAQ4_42>


HTH.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top