Hey, i am having some problems with something pretty simple...
I am very new to javascript and I have been trying to learn from books and tutorials, etc, then i setup little projects for myself and try apply what i learn.
One little project I had was to have text display from an array when you click a link, this link would be a thumbnail image, and the text like an image title. Something simple, but for some reason is does not work.
live example here
It doesn't really seem to do anything, am I missing something?
Here is the Js code.
Possible Help?Code:window.onload = init; function init(){ detailWrite(); colImg(); } function colImg(){ var count = $("#images li").length; //get count of list items for(i=0; i<=count; i++){ //for loop to cycle through length of count detailWrite(i); //send to detailWrite } } function detailWrite(imgNum){ var details = new Array("image1","image2","image3"); //array for the info to write alert(imgNum); $("img" + imgNum).onclick = $("detailInfo").innerHTML = details[imgNum]; //place info in document. }
Thanks


Reply With Quote


Bookmarks