Hi
I made a slideshow that works nicely but run into problems when I try to star/stop it. The code is below.
I get this error: uncaught exception: [Exception... "Could not convert JavaScript argument" nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)" location: "
JS frame ::
http://localhost/hydro.js :: <TOP_LEVEL> :: line 74" data: no]
Can anybody help?
Code:
- Code: Select all
var Pics = new Array();
Index = 0;
function LoadImages()
{
Pics[0] = new Image();
Pics[0].src = "UE Hydro Scheme 001.jpg";
.........................................................................
Pics[21] = new Image();
Pics[21].src = "Bonfirld Ghyll Hydro Bottom of Screw.jpg";
document.images[0].src = Pics[0].src;
}
/**/
Index1 = 0;
function SetTimer()
{
Timer = setInterval("Animate()", 3000);
}
function Animate ()
{
Index1 ++;
if (Index1 > 22) {
Index1 = 0;
};
document.images[0].src = Pics[Index1].src;
}
var start = document.getElementById("start");
addEventListener(start, "click", clickStart, false);
var stop = document.getElementById("stop");
addEventListener(stop, "click", clickStop, false);
function clickStart()
{
Timer = setTimeout("Animate()", 2075);
}
function clickStop () {
clearTimeout(Timer);
}
/Code