本文主要介绍jsp实现图像震动效果、闪烁效果、自动切换图像的资料,废话不多说了,具体代码如下:
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>当鼠标指针经过图像时图像震动效果</title> <style type="text/css"> .zhendimage{ position:relative; } </style> <script type="application/javascript" > var rector =3; var stopit = 0; var a=1; var zhend; function init(which) { stopit =0; zhend = which; zhend.style.left =0; zhend.style.top =0; } function rattleimage() { if(stopit==1) { return; } if(a==1) { zhend.style.top = parseInt(zhend.style.top)+rector+"px"; } else if(a==2) { zhend.style.left = parseInt(zhend.style.left)+rector+"px"; } else if(a==3) { zhend.style.top = parseInt(zhend.style.top)-rector+"px"; } else { zhend.style.left = parseInt(zhend.style.left)-rector+"px"; } if(a<4)a++; else a =1; setTimeout("rattleimage()",50); } function stoprattle(which) { stopit = 1; which.style.left =0; which.style.top =0; } </script> </head> <body> <div> <img class="zhendimage" onmousemove="init(this);rattleimage();" onmouseout="stoprattle(this);" src="http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg002.png" /></div> </body> </html>
2.图片闪烁效果
<!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>图片闪烁效果</title> <script type="application/javascript"> function blink() { //定义图片的显示和隐藏属性 tp.style.visibility = (tp.style.visibility=="hidden")?"visible":"hidden"; //每0.5秒刷新一次 setTimeout("blink()",500); } </script> </head> <body onload="blink();"> <div id="tp"> <img src="http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg003.jpg" style="width:160px; height:160px;" /> </div> </body> </html>
3.自动切换图像
<!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>自动切换图像</title> <script type="application/javascript"> var imgs = new Array ( "http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg003.jpg", "http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg004.gif", "http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_%e6%9a%82%e6%97%a0%e5%9b%be%e7%89%87.gif" ) var nums =0; setInterval("fort()",1000); function fort() { iimg.src = imgs[nums]; nums++; if(nums==3)nums=0; } </script> </head> <body> <div><img id="iimg" src="http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg003.jpg" height="160" width="160" /></div> </body> </html>
希望本文所述对你有所帮助,jsp图片效果大全(图像震动效果、闪烁效果、自动切换图像)内容就给大家介绍到这里了。希望大家继续关注我们的网站!想要学习介绍jsp可以继续关注本站。
更多jsp图片效果大全(图像震动效果、闪烁效果、自动切换图像)相关文章请关注PHP中文网!
声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

Video Face Swap
使用我们完全免费的人工智能换脸工具轻松在任何视频中换脸!

热门文章
如何修复KB5055523无法在Windows 11中安装?
4 周前ByDDD
如何修复KB5055518无法在Windows 10中安装?
4 周前ByDDD
<🎜>:种植花园 - 完整的突变指南
3 周前ByDDD
<🎜>:泡泡胶模拟器无穷大 - 如何获取和使用皇家钥匙
3 周前By尊渡假赌尊渡假赌尊渡假赌
如何修复KB5055612无法在Windows 10中安装?
3 周前ByDDD

热工具

MinGW - 适用于 Windows 的极简 GNU
这个项目正在迁移到osdn.net/projects/mingw的过程中,你可以继续在那里关注我们。MinGW:GNU编译器集合(GCC)的本地Windows移植版本,可自由分发的导入库和用于构建本地Windows应用程序的头文件;包括对MSVC运行时的扩展,以支持C99功能。MinGW的所有软件都可以在64位Windows平台上运行。

ZendStudio 13.5.1 Mac
功能强大的PHP集成开发环境

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。

SublimeText3 英文版
推荐:为Win版本,支持代码提示!

VSCode Windows 64位 下载
微软推出的免费、功能强大的一款IDE编辑器