By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,466 Members | 1,148 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,466 IT Pros & Developers. It's quick & easy.

Change image by clicking link

P: n/a
I suspect this is fairly standard practice, but I've looked on the net
and can't quite find the script I want.

I would like to have a page with an image on which changed depending
on which link next to it is clicked... there will be about 5/6 links
and their associated image.

Thanks very much indeed.

Dave.
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
-DRB- wrote on 18 okt 2003 in comp.lang.javascript:
I suspect this is fairly standard practice, but I've looked on the net
and can't quite find the script I want.

I would like to have a page with an image on which changed depending
on which link next to it is clicked... there will be about 5/6 links
and their associated image.


<img src="img0.jpg" id="im">

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img1.j pg'">
.... </a>

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img2.j pg'">
.... </a>

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img3.j pg'">
.... </a>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

P: n/a

"Evertjan." <ex**************@interxnl.net> skrev i melding
news:Xn********************@194.109.133.29...
-DRB- wrote on 18 okt 2003 in comp.lang.javascript:
I suspect this is fairly standard practice, but I've looked on the net
and can't quite find the script I want.

I would like to have a page with an image on which changed depending
on which link next to it is clicked... there will be about 5/6 links
and their associated image.


<img src="img0.jpg" id="im">

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img1.j pg'">
... </a>

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img2.j pg'">
... </a>

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img3.j pg'">
... </a>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


And the image size of the replaced picture must be the same as the original
picture, or?
Jul 20 '05 #3

P: n/a
Geir Klemetsen wrote on 19 okt 2003 in comp.lang.javascript:
"Evertjan." <ex**************@interxnl.net> skrev i melding
> I would like to have a page with an image on which changed
> depending on which link next to it is clicked... there will be
> about 5/6 links and their associated image.


<img src="img0.jpg" id="im">

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img1.j pg'">
... </a>

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img2.j pg'">
... </a>

<a href=".." target="_blank"
onclick="document.getElementById('im').src='img3.j pg'">
... </a>

And the image size of the replaced picture must be the same as the
original picture, or?


"Must" is too much,
but it is the usual idea with image replacing,
if you want to keep the user happy.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.