Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Newbie: How do I <IMG> and onClick

Reply
Thread Tools

Newbie: How do I <IMG> and onClick

 
 
Randell D.
Guest
Posts: n/a
 
      09-26-2003

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,menub ar="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?


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      09-26-2003


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/

 
Reply With Quote
 
 
 
 
Randell D.
Guest
Posts: n/a
 
      09-26-2003

"Martin Honnen" <(E-Mail Removed)> wrote in message
news:3f740324$(E-Mail Removed)...
>
>
> 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...


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
<tr> and onclick and a checkbox... Sonnich Jensen Javascript 5 08-24-2007 11:57 AM
Overriding an onclick with another onclick tomlong@gmail.com Javascript 4 01-26-2006 09:26 PM
button.onclick = new Function("func2()") + button.onclick foldface@yahoo.co.uk Javascript 2 09-26-2005 08:13 AM
document.onclick=doIt() same as document.onclick=doIt ? bob Javascript 3 08-21-2003 12:14 PM



Advertisments