この記事では、画像の振動効果、ちらつき効果、および画像の自動切り替え情報を実現するための JSP を主に紹介します。具体的なコードは次のとおりです。
<!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 lazy" src="/static/imghwm/default1.png" data-src="http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg002.png" onmousemove="init(this);rattleimage();" onmouseout="stoprattle(this);" /></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="/static/imghwm/default1.png" data-src="http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg003.jpg" class="lazy" style="max-width:90%" / alt="jspピクチャーエフェクト集(画像の振動エフェクト、点滅エフェクト、画像の自動切り替え)" > </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 src="/static/imghwm/default1.png" data-src="http://images.cnblogs.com/cnblogs_com/yc-755909659/559257/o_ycimg003.jpg" class="lazy" id="iimg" style="max-width:90%" style="max-width:90%" / alt="jspピクチャーエフェクト集(画像の振動エフェクト、点滅エフェクト、画像の自動切り替え)" ></div> </body> </html>JSP の画像エフェクト(画像振動エフェクト、点滅エフェクト、画像自動切り替え)の内容を紹介します。ここにいる。 jsp を学び、紹介したい場合は、引き続きこのサイトに注目していただければ幸いです。 その他の JSP 画像エフェクト (画像振動エフェクト、点滅エフェクト、自動画像切り替え) 関連記事については、PHP 中国語 Web サイトに注目してください。
声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事
<🎜>:庭を育てる - 完全な突然変異ガイド
3週間前ByDDD
<🎜>:バブルガムシミュレーターインフィニティ - ロイヤルキーの取得と使用方法
3週間前By尊渡假赌尊渡假赌尊渡假赌
Nordhold:Fusion System、説明
3週間前By尊渡假赌尊渡假赌尊渡假赌
マンドラゴラ:魔女の木のささやき - グラップリングフックのロックを解除する方法
3週間前By尊渡假赌尊渡假赌尊渡假赌

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

SublimeText3 Linux 新バージョン
SublimeText3 Linux 最新バージョン

WebStorm Mac版
便利なJavaScript開発ツール
