I'll firstly admit I'm a lot more productive when using jQuery, however I've been asked to implement a gallery written in vanilla JavScript. My normal javascript DOM skills are only average.
This is the gallery I've been asked to implement
http://sandbox.leigeber.com/slideshow/
Now I've chopped and changed it ever so slightly so it'd fit into the new site's templating system a bit easier.
Whenever I run it, this line causes an error
ta=document.getElementById(thumbid);
Saying that ta
is null. I know the thumbid var's value does exist as an Id of the unordered list.
My implementation is at
http://ikatanspa.com/~new/image-gallery/
I've tried to figure what's been going on for at least half an hour now, and can't seem to nail it!
Can someone please tell me what I'm doing wrong?
Thanks
UPDATE
Thanks for the answers. I put the getElementById() stuff into the init method of the function (where I guess it should be).