栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

悬停更改图像

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

悬停更改图像

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

<!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);}


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/575800.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号