SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    michigan
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onclick,swapping image and links

    How do I call my function, have it swap the image and at the same time have the onClick take the user to a different URL or page ID.

    <a onclick="return showImage(this)" href="\images\crafts.gif"></a>

  2. #2
    SitePoint Enthusiast yjgx007's Avatar
    Join Date
    Jul 2004
    Location
    China or Singapore?
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a better solution:

    <a onclick="return showImage(this)" href="\images\crafts.gif">rrrr</a>
    <script>
    function showImage(obj)
    {
    obj.href = "\\images\\another.gif";
    return true;
    }
    </script>

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    michigan
    Posts
    26
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •