By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,473 Members | 1,278 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,473 IT Pros & Developers. It's quick & easy.

next / previous image swap WITH larger image popup

P: n/a
Very simply what I need to do is almost identical to what you see here:

http://www.java-scripts.net/javascri...w-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.
Sep 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Clay wrote:
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.
Sep 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.