简体   繁体   中英

Multiple Image on rollover

What I want to do is have 2 images appear when I rollover an image, the first is achieved by using this code, and is a normal rollover:

<a href="#" onmouseout="MM_swapImgRestore()"
onmouseover="MM_swapImage('','','images/image2.jpg',1)">
<img src="image1.jpg" alt="imageDesc" width="120" height="125" id="Ammar" /></a>

The second image is an info text box which I went to appear slightly offset from the original (ie bottom-right or bottom-left with a slight over lap).

How can this effect be achieved? Here is an example for clarification

如果将第一张图片放入div并设置id="myDiv ,则可以在onmouseover代码中像这样更改div的内容

document.getElementById('myDiv').innerHTML="<img ... /> <img ... />";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM