Lensmeister
Coder
Hello all,
I have found this bit of code online that is almost what I want but I can't fathom how to sort it in to something to use.
Everything shows to click the image but not other text.
My web page will have a lot of text then towards the bottom it will need to display an image (a graph in fact as a .gif)
In my image folder there will be the following three image files.
cardiff.gif
manchester.gif
both.gif
So loosely there will be the three words on one line and under it there will be the imag.
Cardiff | Manchester | Both
IMAGE HERE
If Cardiff is clicked then cardiff.gif shows, When Manchester is clicked then manchester.gif ... well you get the idea.
How can I do this please?
Also if it is possible when clicked the caption is changed ?
Thanks in advance for any help you can give.
I have found this bit of code online that is almost what I want but I can't fathom how to sort it in to something to use.
Everything shows to click the image but not other text.
Code:
<html>
<body>
<img id ="imageOne" src ="circleRed.png" onclick = "changeColor()"/>
<script>
var image = document.getElementById("imageOne");
function changeColor()
{
if (image.getAttribute('src') == "circleRed.png")
{
image.src = "circleBlue.png";
}
else
{
image.src = "circleRed.png";
}
}
</script>
</body>
</html>
My web page will have a lot of text then towards the bottom it will need to display an image (a graph in fact as a .gif)
In my image folder there will be the following three image files.
cardiff.gif
manchester.gif
both.gif
So loosely there will be the three words on one line and under it there will be the imag.
Cardiff | Manchester | Both
IMAGE HERE
If Cardiff is clicked then cardiff.gif shows, When Manchester is clicked then manchester.gif ... well you get the idea.
How can I do this please?
Also if it is possible when clicked the caption is changed ?
Thanks in advance for any help you can give.