Hello there,
I'm trying to make an very easy imageswap (that is what I thought at least), just by clicking on an image the next image has to appear, by clicking again the previous should appear. The code I have so far looks like this (thanks Banger):
<html>
<head>
<title>test</title>
<script language="javascript">
var changeMeBackPlease = false;
function imageSwap(image){
// change image back
if(changeMeBackPlease=="false"
{
image.src = OLDSRC;
}
else
{
image.src = "images/plusje.gif"; HERE I GET AN (DEBUG)ERROR: "UNDEFINED IS 'NULL' OR NOT AN OBJECT"
}
// reset the variable depending what it is now
// Just swaps or inverts the true/false value
changeMeBackPlease =(changeMeBackPlease)?false:true;
}
</script>
</head>
<body>
<img src="images/woordassistentie.gif" OLDSRC="images/woordassistentie.gif" onClick="imageSwap()">
</body>
</html>
So, I get the image woordassistentie.gif, but when clicking it I get an error and do not get plusje.gif.
Any suggestions?
Thanks, Mariootje
I'm trying to make an very easy imageswap (that is what I thought at least), just by clicking on an image the next image has to appear, by clicking again the previous should appear. The code I have so far looks like this (thanks Banger):
<html>
<head>
<title>test</title>
<script language="javascript">
var changeMeBackPlease = false;
function imageSwap(image){
// change image back
if(changeMeBackPlease=="false"
image.src = OLDSRC;
}
else
{
image.src = "images/plusje.gif"; HERE I GET AN (DEBUG)ERROR: "UNDEFINED IS 'NULL' OR NOT AN OBJECT"
}
// reset the variable depending what it is now
// Just swaps or inverts the true/false value
changeMeBackPlease =(changeMeBackPlease)?false:true;
}
</script>
</head>
<body>
<img src="images/woordassistentie.gif" OLDSRC="images/woordassistentie.gif" onClick="imageSwap()">
</body>
</html>
So, I get the image woordassistentie.gif, but when clicking it I get an error and do not get plusje.gif.
Any suggestions?
Thanks, Mariootje