473,611 Members | 2,236 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change image by clicking link

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
3 63711
-DRB- wrote on 18 okt 2003 in comp.lang.javas cript:
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="docume nt.getElementBy Id('im').src='i mg1.jpg'">
.... </a>

<a href=".." target="_blank"
onclick="docume nt.getElementBy Id('im').src='i mg2.jpg'">
.... </a>

<a href=".." target="_blank"
onclick="docume nt.getElementBy Id('im').src='i mg3.jpg'">
.... </a>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

"Evertjan." <ex************ **@interxnl.net > skrev i melding
news:Xn******** ************@19 4.109.133.29...
-DRB- wrote on 18 okt 2003 in comp.lang.javas cript:
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="docume nt.getElementBy Id('im').src='i mg1.jpg'">
... </a>

<a href=".." target="_blank"
onclick="docume nt.getElementBy Id('im').src='i mg2.jpg'">
... </a>

<a href=".." target="_blank"
onclick="docume nt.getElementBy Id('im').src='i mg3.jpg'">
... </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
Geir Klemetsen wrote on 19 okt 2003 in comp.lang.javas cript:
"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="docume nt.getElementBy Id('im').src='i mg1.jpg'">
... </a>

<a href=".." target="_blank"
onclick="docume nt.getElementBy Id('im').src='i mg2.jpg'">
... </a>

<a href=".." target="_blank"
onclick="docume nt.getElementBy Id('im').src='i mg3.jpg'">
... </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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9157
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse down (onClick) on the same image or link. Upon releasing the mouse (onMouseOut), the
0
2283
by: zPaul | last post by:
I would like to change image that says "loading" while loading a file. If that is not possible, change text in label. I was able to change the image in ASP but, can't do it in dotnet. Does anyone know how? Thanks,
6
22119
by: ruca | last post by:
Hi gurus, I have a imagebutton in my WebForm, and I want that when I click (mouse down) on her the imagebutton change image and when I "unclick" (mouse up) change to the original image. Basically I want to know how can I have the mousedown and mouseup buttons events. I think that I have to do this in JavaScript. Can you help me on this?
6
3184
by: Karl | last post by:
Hi, Ok so on a given page I have 4 text links: see it in black see it in blue see it in red see it in green using the standard swap image behavior, clicking on one of the above links
3
2930
by: ajaspersonal | last post by:
"i want to change font_style (hyper link<a href...>text</a>) normal to italics.when load a page" this is my problem but that label included in one 'USERCONTROL' This user controls may condain 4 link (<a href...>page1.aspx</a <br <a href ....>page2</aetc..). that will redirect another page ex:(page1.aspx).
7
19297
by: kadarkarai | last post by:
I am developing photo gallery in Macromedia Flash 8 and XML to retrive the Image. Image Size is all in different size. my question is How to Change image size at runtime in flash? so that image display one by one automatically with correct resized image please help thanks in advances
1
6648
by: sbettadpur | last post by:
hello, I installed joomla 1.5 on windows xp, and i created my own template and i installed successfully in joomla 1.5. My question is I want to change the menu link for example if i click in Contact us hyperlink that page should redirect to contactus.php similiary if i click on About us hyperlink that should redirect to aboutus.php. How can i implement this one in joomla please get me some suggestion, because i am very much fed up with...
1
3344
by: Vidya A | last post by:
How to select a row in a grid view by clicking link button in asp.net with VB.
0
8097
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8561
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8240
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8411
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7038
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6072
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5527
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1692
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.