next / previous image swap WITH larger image popup

Discussion in 'Javascript' started by Clay, Sep 28, 2006.

  1. Clay

    Clay Guest

    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.
    Clay, Sep 28, 2006
    #1
    1. Advertising

  2. Clay

    Elegie Guest

    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.
    Elegie, Sep 28, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Williams
    Replies:
    1
    Views:
    1,357
    Dylan Parry
    Jun 3, 2005
  2. Deniz Bahar
    Replies:
    2
    Views:
    451
    Andrey Tarasevich
    Mar 9, 2005
  3. Niels Dekker (no reply address)

    What swap is called when using std::swap?

    Niels Dekker (no reply address), Jul 19, 2006, in forum: C++
    Replies:
    4
    Views:
    974
    Niels Dekker (no reply address)
    Jul 20, 2006
  4. csgraham74

    Image to load in larger popup

    csgraham74, May 22, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    112
    csgraham74
    May 23, 2005
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    499
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page