Newbie: How do I <IMG> and onClick

R

Randell D.

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
 
M

Martin Honnen

Randell said:
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
 
R

Randell D.

Martin Honnen said:
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...
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top