Newbie: How do I <IMG> and onClick

Discussion in 'Javascript' started by Randell D., Sep 26, 2003.

  1. Randell D.

    Randell D. Guest

    Folks,

    I have loads of posts that I save on to my laptop that answer questions I
    know at some point I'll need... however I can't seem to sort out an onClick
    event... basically, I have thumbnails and when they are clicked, a popup
    showing the full sized image takes place...

    I've looked at a few of the examples I have but some have the onClick event
    in a <A HREF></A> tag, while others have it inside a <img src> tag.

    Whats the recommended procedure and how best could I implement a solution?
    and can I legally do something like

    <img src=/image.jpg onclick="open( "/bigImage.jpg","win_name",
    "width="200",height="300",status=0,toolbar=0,menubar="no",resizable=no,locat
    ion=0,scrollbars="0""); return">

    all help, via ng is much appreciated
    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is top-posting such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet?
    Randell D., Sep 26, 2003
    #1
    1. Advertising

  2. Randell D. wrote:

    > Folks,
    >
    > I have loads of posts that I save on to my laptop that answer questions I
    > know at some point I'll need... however I can't seem to sort out an onClick
    > event... basically, I have thumbnails and when they are clicked, a popup
    > showing the full sized image takes place...
    >
    > I've looked at a few of the examples I have but some have the onClick event
    > in a <A HREF></A> tag, while others have it inside a <img src> tag.


    Yes, Netscape 4 (and earlier browsers like Netscape 3 or IE3 but those
    are no longer used) doesn't support
    <img onclick
    therefore to cater for NN4 you have to use
    <a href="whatever.gif"
    target="windowName"
    onclick="window.open(this.href, this.target, '...');
    return false;"><img ...></a>
    Using this approach has the advantage that it works even if JavaScript
    is disabled while
    <img onclick="window.open(...)
    relies on JavaScript



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Sep 26, 2003
    #2
    1. Advertising

  3. Randell D.

    Randell D. Guest

    "Martin Honnen" <> wrote in message
    news:3f740324$...
    >
    >
    > Randell D. wrote:
    >
    > > Folks,
    > >
    > > I have loads of posts that I save on to my laptop that answer questions

    I
    > > know at some point I'll need... however I can't seem to sort out an

    onClick
    > > event... basically, I have thumbnails and when they are clicked, a popup
    > > showing the full sized image takes place...
    > >
    > > I've looked at a few of the examples I have but some have the onClick

    event
    > > in a <A HREF></A> tag, while others have it inside a <img src> tag.

    >
    > Yes, Netscape 4 (and earlier browsers like Netscape 3 or IE3 but those
    > are no longer used) doesn't support
    > <img onclick
    > therefore to cater for NN4 you have to use
    > <a href="whatever.gif"
    > target="windowName"
    > onclick="window.open(this.href, this.target, '...');
    > return false;"><img ...></a>
    > Using this approach has the advantage that it works even if JavaScript
    > is disabled while
    > <img onclick="window.open(...)
    > relies on JavaScript
    >


    Thanks for that...
    Randell D., Sep 26, 2003
    #3
    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. news.austin.rr.com

    how to download img from html img tag

    news.austin.rr.com, Apr 27, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    505
    Steve C. Orr [MVP, MCSD]
    Apr 27, 2005
  2. Philipp Lenssen

    Problem: <img></img>

    Philipp Lenssen, Jun 27, 2005, in forum: XML
    Replies:
    15
    Views:
    754
    David Håsäther
    Jul 3, 2005
  3. Jopek
    Replies:
    7
    Views:
    397
    dorayme
    Apr 26, 2009
  4. Replies:
    7
    Views:
    177
    Tad McClellan
    Jun 22, 2006
  5. Replies:
    4
    Views:
    125
Loading...

Share This Page