I tried to simplify the the code, but I ended up making a hash of things,
It is DHTML because I brought CSS into the mix (not visible in my pityful earlier post)
I can code but my jargon sux like **** (I don't converse verbally with other coders..)
anyways here goes:
function viewPhoto(thumb){
document.getElementById('mainPhoto').src=thumb.href;
thumbs = document.getElementById('property-thumbnail-browser').getElementsByTagName('img');
for(i=0; i<thumbs.length; i++){
thumbs[i].className="thumbnail-normal";
}
thumb.firstChild.className="thumbnail-current";
return false;
}
I want to neaten this code by changing the loop logic to:
function viewPhoto(thumb){
document.getElementById('mainPhoto').src=thumb.href;
thumbs = document.getElementById('property-thumbnail-browser').getElementsByTagName('img');
for(i=0; i<thumbs.length; i++){
< If this is the image i clicked on > <-- I need to find the Index of the object???
thumb.firstChild.className="thumbnail-current";
< Else >
thumbs[i].className="thumbnail-normal";
}
return false;
}
I know this looks crude because the firstChild etc. relies implicitly on my markup being precise,
but it works for me... Another wierd thing I noticed was Firefox treating a literal space ' ' in
your markup as a Node?
Received on Mon May 1 03:10:31 2006