文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>鼠标实现图片的渐有渐无

鼠标实现图片的渐有渐无

时间:2007-02-17  来源:PHP爱好者

1,CSS,JS,IMG一个都不能少运行代码框
<style type="text/css"><!--.trans_img {filter:alpha(opacity=30,enabled=1) blendtrans(duration=1); border:0 solid black}--></style><script language=javascript> function transImg(obj,enable) { obj.filters.blendtrans.Apply(); obj.filters[0].enabled=enable; obj.filters.blendtrans.Play(); }</script><img src="../images_html/200632121537470.gif" class="trans_img" onmouseover="transImg(this,0)" onmouseout="transImg(this,1)">
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]2,JS & IMG运行代码框
<script language="JavaScript"> nereidFadeObjects = new Object();nereidFadeTimers = new Object();function nereidFade(object, destOp, rate, delta){if (!document.all)return if (object != "[object]"){ file://do this so I can take a string too setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0); return; } clearTimeout(nereidFadeTimers[object.sourceIndex]); diff = destOp-object.filters.alpha.opacity; direction = 1; if (object.filters.alpha.opacity > destOp){ direction = -1; } delta=Math.min(direction*diff,delta); object.filters.alpha.opacity+=direction*delta; if (object.filters.alpha.opacity != destOp){ nereidFadeObjects[object.sourceIndex]=object; nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate); }}</script><a href="http://www.cnbruce.com/" target="_blank"><img border="0" src=../images_html/a>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]3,用htc文件,不用JS从而减轻工作量。
下载alpha.htc: http://www.cnbruce.com/js/alpha.htc

效果页查看:http://www.cnbruce.com/js/a.html  4,有点Flash的味道,一闪而过。运行代码框
<SCRIPT language=Javascript type=text/javascript>function trains(id,text){document.all[id].innerHTML=' '+text}function trainpic(id,text){document.all[id].innerHTML='<img src="'+text+'.gif">'}function high(which2){theobject=which2;theobject.filters.alpha.opacity=0highlighting=setInterval("highlightit(theobject)",50)}function low(which2){clearInterval(highlighting)which2.filters.alpha.opacity=100}function highlightit(cur2){if (cur2.filters.alpha.opacity<100)cur2.filters.alpha.opacity+=15else if(window.highting)clearInterval(highlighting)}</SCRIPT><a href="http://www.cnbruce.com/"><IMG onmouseover="this.style.filter='alpha(opacity=100)';high(this)" onmouseout="low(this)" src="../images_html/200632121537470.gif" border="0"></a>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]5,还有图片的“黑白转彩色”运行代码框
<SCRIPT>function doTrans(filterCode) {imgObj.filters[0].apply();oImg.style.filter = filterCodeimgObj.filters[0].play();}</SCRIPT><SPAN id=imgObj onmouseleave='doTrans("gray")' style="FILTER: progid:DXImageTransform.Microsoft.Fade(Overlap=1.00); WIDTH: 1px" onmouseenter='doTrans("")'><IMG id=oImg style="FILTER: gray" src="../images_html/200632121537470.gif"> </SPAN>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行] (出处:蓝色理想)
php爱好者站 http://www.phpfans.net dreamweaver|flash|fireworks|photoshop.
相关阅读 更多 +
排行榜 更多 +
橡皮人过马路游戏下载

橡皮人过马路游戏下载

休闲益智 下载
最强投掷射手下载安装

最强投掷射手下载安装

休闲益智 下载
丛林冒险记安卓下载

丛林冒险记安卓下载

休闲益智 下载