Jump to content

Imagegallery


abdelelbouhy

Recommended Posts

hello guys i'm trying to create image gallery but i found a problem with the event handeler from the external file it doesn't work all the script is working but when i try to include the eventhandler within the script it doesn't work if you please helpwindow.onload = prepare;function prepare(){var target = document.getElementById("imagegallery");var lin = target.getElementsByTagName("a");for(i = 0; i < lin.length; i++){lin.onClick = function(){return showPic(this);}}}function showPic(whichPic){var placeHolder = document.getElementById("holder");var source = whichPic.getAttribute("href");placeHolder.setAttribute("src",source);var oldText = document.getElementById("text1");var textSource = whichPic.getAttribute("title");oldText.firstChild.nodeValue = textSource;return false;}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...