marilynn.fowler
06-02-2006, 08:24 PM
When a user rolls over a thumbnail the image with the ID 'placeholder' should change and the text with the ID 'caption' should change. The images are preloaded. I can't see my flaw. Here's my function:
function showProject (whichProject)
if (document.getElementById) {
document.getElementById('placeholder').src = whichProject.src;
if (whichProject.title) {
document.getElementById('caption').childNodes[0].nodeValue = whichProject.title;
}
else {
document.getElementById('caption').childNodes[0].nodeValue = whichPhoto.childNodes[0].nodeValue;
}
return false;
}
else {
return true;
}
}
\0\0
He!\0\0pف\0pف\0oad (pared down):
if (document.images) {
niche = new Image;
niche.src = 'images/more/niche.jpg';
}
Here's my line item:
<A onMouseOver="javascript:showProject('niche')" HREF="more_niches.html"
TITLE="Large kitchen niche"><IMG SRC="images/more/niche_large_t.jpg"></A>
function showProject (whichProject)
if (document.getElementById) {
document.getElementById('placeholder').src = whichProject.src;
if (whichProject.title) {
document.getElementById('caption').childNodes[0].nodeValue = whichProject.title;
}
else {
document.getElementById('caption').childNodes[0].nodeValue = whichPhoto.childNodes[0].nodeValue;
}
return false;
}
else {
return true;
}
}
\0\0
He!\0\0pف\0pف\0oad (pared down):
if (document.images) {
niche = new Image;
niche.src = 'images/more/niche.jpg';
}
Here's my line item:
<A onMouseOver="javascript:showProject('niche')" HREF="more_niches.html"
TITLE="Large kitchen niche"><IMG SRC="images/more/niche_large_t.jpg"></A>