I have a page (the whole source code can be found here: http://wgcscouts.co.uk/ncubs.php)
where i'm trying to make a rotating image, but nothing is coming up
The javascript is
the alert comes back as null
Anyone any ideas
where i'm trying to make a rotating image, but nothing is coming up
The javascript is
Code:
<script language="JavaScript" type="text/javascript" >// JavaScript Document var idx=0;
var links=[{img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-011.jpg",
url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-011.jpg"},
{img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-015.jpg",
url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-015.jpg"},
{img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-030.jpg",
url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-030.jpg"},
{img:"http://wgscouts.co.uk/images/photos/t_summercamp/camp-2010-040.jpg",
url:"http://wgscouts.co.uk/images/photos/summercamp/camp-2010-040.jpg"}];
function setImage()
{
var link=document.getElementById("changing_link");
var img=document.getElementById("changing_image");
alert(link);
link.href=links[idx].url;
img.src=links[idx].img;
++idx;
if(idx==links.length)
idx=0;
window.setTimeout(setImage,1000);
}</script>
the alert comes back as null
Anyone any ideas