悬停更改图像

悬停更改图像,第1张

悬停更改图像

请尝试以下代码。工作正常

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">    <head>        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />        <title>Untitled document</title><br />    </head>    <body>        <p> <script type="text/javascript" language="javascript">     function changeImage(img){        document.getElementById('bigImage').src=img;     } </script> <img src="../Pictures/lightcircle.png" alt="" width="284" height="156" id="bigImage" /> <p>&nbsp; </p> <div>     <p>         <img src="../Pictures/lightcircle2.png" height=79 width=78 onmouseover="changeImage('../Pictures/lightcircle2.png')"/>     </p>     <p><img src="../Pictures/lightcircle.png" alt="" width="120" height="100" onmouseover="changeImage('../Pictures/lightcircle.png')"/></p>     <p><img src="../Pictures/lightcircle2.png" alt="" width="78" height="79" onmouseover="changeImage('../Pictures/lightcircle2.png')"/></p>     <p>&nbsp;</p>     </br> </div>    </body></html>

我修改了代码,希望它能稍作延迟。.但是,它不是动画。

function changeImage(img){    // document.getElementById('bigImage').src=img;    setTimeout(function() {document.getElementById('bigImage').src=img;},1250);}


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5567025.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-14
下一篇2022-12-14

发表评论

登录后才能评论

评论列表(0条)

    保存