Hi folks,
I have a question regarding a script.
I´ve made a page with a number of buttons. When you move the cursor over each one of them, a picture shows in another part of the page which contains info about the buttons subject. I would like that picture to be permanently visible when you´ve clicked on the button instead of disappearing again. I´ve tried experimenting with the “OnClick” & “TurnOn” commando but I can´t get it to work.
Here´s the code attached to the button:
[CODE]<a href=”javascript:pop00()”
onMouseOver=”turnDown(‘image101’, ‘popup1.src’);”
onMouseOut=”turnOff(‘image1’);turnOff(‘image101’);”
onMouseDown=”turnDown(‘image101’, ‘popup1.src’);”
onClick=”turnOn(‘image101’, ‘popup1.src’);”>
<img name=”image1″ src=”images/greendot.gif” border=”0″ width=”26″ height=”26″ align=”middle”></a>
And here´s the main script within the head marks. I wonder if I should change anything here too?
[CODE]<script>
<!–
if (document.images) {
image101off = new Image();
image101off.src = “popup1_blank.gif”;
image102off = new Image();
image102off.src = “popup2_blank.gif”;
image103off = new Image();
image103off.src = “popup3_blank.gif”;
image1on = new Image();
image1on.src = “bild1_over.gif”;
image1off = new Image();
image1off.src = “bild1.gif”;
image101popup1 = new Image();
image101popup1.src = “popup1.jpg”;
image2on = new Image();
image2on.src = “bild2_over.gif”;
image2off = new Image();
image2off.src = “bild2.gif”;
image102popup2 = new Image();
image102popup2.src = “popup2.jpg”;
image3on = new Image();
image3on.src = “bild3_over.gif”;
image3off = new Image();
image3off.src = “bild3.gif”;
image103popup3 = new Image();
image103popup3.src = “popup3.jpg”;
}
function turnOn(imageName)
{
if (document.images) {
document[imageName].src = eval(imageName + “on.src”);
}
}
function turnOff(imageName) {
if (document.images)
{
document[imageName].src = eval(imageName + “off.src”);
}
}
function turnDown(imageName, imageEnd) {
if (document.images)
{
document[imageName].src = eval(imageName + imageEnd);
}
}
// –>
</script>
I´m tearing my imagined hair about this. Would be a great relief if anyone had an answer to this.
Peace/Ilja