PEJO wrote on 28 mei 2007 in comp.lang.javascript
:
OK I've tried this.. I'm getting a JS error when I rollover the small
image. It swaps the image but not the links.
PLEASE do not toppost, but post under each part of the text you aree
reacting on.
here is the code I implemented as per your explanation.
for the thumbnail:
<a href="http://glasstoilets.com/catalog/tank1-p-28.html"
onMouseOver="MM_swapImage('Bass_model_s','','Files/images/70x50/Bass_mo
MM_swapImage() what function is that?
del.jpg',1);MM_swapImage('Main_Image','','Files/images/300x216/Bass_mod
el.jpg',1)"><img src="Files/images/70x50/Bass_model.jpg"
onMouseOver="document.getElementById('Plnk').href= 'http://glasstoilets.
com/catalog/tank1-p-28.html';" name="Bass_model_s" border="0"
id="Bass_model_s"></a>
So you have TWO onmouseovers over each other,
each changing some attribute of the other?
Why?
I do not even know what you want to accomplish.
Do you?
Why would you want to change an <ahref on mouseover, since you cannt
click it without first hoovering?
(The Debug popup points to an error in the above code.)
What is a "Debug popup"?
What error?
What line of code?
btw, why do you name an img that has a id?
here is what I have for the main image as well
<img src="Files/images/300x216/PICT0876.jpg" name="Main_Image"
width="300" height="216" id="Plnk">
==============================
The best I can do for you is deleting all the code junk that is not
part of the probem and show you this:
<img
src='PICT0876.jpg'
id='Plnk'
>
<br><br>
<img
src='img1.jpg'
onMouseOver='doit(this);'
onClick= 'goThere();'
alt = 'Hover me or click me!'
>
<script type='text/javascript'>
function doit(x) {
x.src = 'img2.jpg';
x.style.cursor = 'pointer';
document.getElementById('Plnk').src =
'PICT0999999.jpg';
};
function goThere() {
location.href = 'http://cnn.com/';
};
</script>
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)