Hi
Im trying to make a script which when I click on the list element... it will replace a big image with anotehr picture. The list element is a thumbnail... and I want to swop the big image with the big version of the thumbnail.
Each <li> has a rel attribute... but while I can pull out each <li> from the list, for some reason the following code, yields an 'undefined' value... instead of the big-image-path...?
Help!
<li rel="kids_beach.jpg">
<img src="http://localhost/stirling/public/content/thumbs/kids_beach_thumb.jpg" border="0" />
</li>
//getting all <li> from the list of thumbnails
var all_items = list.getElementsByTagName('li');
for(i in all_items)
{
//this should set the value of the big image
//to the value of the rel attribute of the thumbnail list item
all_items[i].onclick = function(){
main_image.src = dynamicImg('public/content/images/' + all_items[i].rel);
};
}