问题
I was wondering if you can tell me how I can do the following: when hovering over an image, two or more images change.
Im kind of new at this, so please give me clear directions
回答1:
Adapt this example to suit.
var image1 = document.getElementById('image1'),
image2 = document.getElementById('image2'),
image3 = document.getElementById('image3');
image1.onmouseover = function() {
image2.src = 'whatever.jpg';
image3.src = 'something.png';
}
来源:https://stackoverflow.com/questions/6328580/when-hovering-over-an-image-how-can-i-make-two-or-more-images-change