带点特效
<script>
function Flash(bStatus)
{
if(ImgDivID.filters.glow.enabled==1)
{
ImgDivID.filters.glow.enabled=0;
}
if(ImgDivID.filters.blendTrans.status==0)
{
ImgDivID.filters.blendTrans.apply();
ImgDivID.filters.glow.enabled=1;
ImgDivID.filters.blendTrans.play();
}
if(bStatus=="1")
{
ImgID.src="中国的航母.jpg";
}
else
{
ImgID.src="中国自行火炮系列.jpg";
}
}
</script>
<div id=ImgDivID onmouseout=Flash("1") onmouseover=Flash("0")
style="filter:glow(color=#ffff00,strength=20,enabled=0) blendTrans(duration=2);height:400px">
<img src="中国自行火炮系列.jpg" id="ImgID">
</div>
<script>
function Flash(bStatus)
{
if(ImgDivID.filters.glow.enabled==1)
{
ImgDivID.filters.glow.enabled=0;
}
if(ImgDivID.filters.blendTrans.status==0)
{
ImgDivID.filters.blendTrans.apply();
ImgDivID.filters.glow.enabled=1;
ImgDivID.filters.blendTrans.play();
}
if(bStatus=="1")
{
ImgID.src="中国的航母.jpg";
}
else
{
ImgID.src="中国自行火炮系列.jpg";
}
}
</script>
<div id=ImgDivID onmouseout=Flash("1") onmouseover=Flash("0")
style="filter:glow(color=#ffff00,strength=20,enabled=0) blendTrans(duration=2);height:400px">
<img src="中国自行火炮系列.jpg" id="ImgID">
</div>
解决方案 »
- 禁止alert运行。
- 哪位大哥看看这个js 怎么写啊?String 转数组问题
- 怎样用键盘控制光标?
- 如何使用JavaScript的循环添加列表框的选项?
- 小菜提问,请各位帮我呀! 在线散分100呀
- 各位大侠,看看怎么传参数。在线等
- 脚本错误: document.all.recArchived.style.display 为空或不是对象
- 我想让表单中的“用户名”栏只能填入字母和数字和下划线,请问怎样写代码?
- 关于自动刷新问题
- 用两个按钮来控制input type="text"中文字的大小和颜色 谁能帮帮忙?
- 在线急等:两个frame中textbox相互赋值的问题,困扰多时了
- 能否让IE弹出的小窗口不在任务栏上显示?
<td><img src="tab2_off.gif" onClick="*****"></td>
<td><img src="tab3_off.gif" onClick="*****"></td>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language="javascript">
function chan(oObj)
{
var arrObj = document.getElementsByName("n");
for(var i=0; i<arrObj.length; i++)
arrObj[i].src = arrObj[i].preSrc;
oObj.src = "4.gif";
}
function init()
{
var arrObj = document.getElementsByName("n");
for(var i=0; i<arrObj.length; i++)
arrObj[i].preSrc = arrObj[i].src;
}
</SCRIPT>
</HEAD><BODY onLoad="init()">
<INPUT type = "image" src = "1.gif" name = "n" onClick="chan(this)">
<INPUT type = "image" src = "2.gif" name = "n" onClick="chan(this)">
<INPUT type = "image" src = "3.gif" name = "n" onClick="chan(this)">
</BODY>
</HTML>
IMG
{
DefineIMGOnMouseOver:expression(this.onmouseover=function(){this.src=this.src.replace('on','off');});DefineIMGOnMouseOut:expression(this.onmouseout=function(){this.src=this.src.replace('off','on');});
}
</style>
毎個按鈕有二個状態:tab1_on.gif(on)、tab1_off.gif(off)組合是:
tab1_on.gif、tab1_off.gif
tab2_on.gif、tab2_off.gif
tab3_on.gif、tab3_off.gif
tab4_on.gif、tab4_off.gif当按其中一個時、置成ON状態的图片、其他自動的変成相応的OFF状態的图片。
<img src="tab2_off.gif" onClick="test()">
<img src="tab3_off.gif" onClick="test()">
<img src="tab4_off.gif" onClick="test()">
<script>
function test(){
var e = document.getElementsByTagName("IMG");
var o = event.srcElement;
for (var i=0; i<e.length; i++){
if (e[i].src.toString().indexOf("tab")==-1 || e[i]==o) continue;
e[i].src = (e[i].src.toString().indexOf("off")!=-1)?("tab_"+i+"_on.gif"):("tab"+i+"_off.gif");
}
e.src = e.src.replace(/off/,'on');
}
<script>
<script>
function test(){
var e = document.getElementsByTagName("IMG");
var o = event.srcElement;
for (var i=0; i<e.length; i++){
if (e[i].src.toString().indexOf("tab")==-1 || e[i]==o) continue;
e[i].src = (e[i].src.toString().indexOf("off")!=-1)?("tab_"+i+"_on.gif"):("tab"+i+"_off.gif");
}
o.src = o.src.replace(/off/,'on');
}
</script>
function t(s)
{
var i;
for(i=1;i<=4;i++)
{
var el=eval("document.all.tab"+i)
if(i==s)
el.src="tab"+i+"_on.gif"
else
el.src="tab"+i+"_off.gif"
}}
</script>
<img src="tab1_on.gif" onclick="t(1)" id="tab1">
<img src="tab2_on.gif" onclick="t(2)" id="tab2">
<img src="tab3_on.gif" onclick="t(3)" id="tab3">
<img src="tab4_on.gif" onclick="t(4)" id="tab4">
LxcJie(肖冲)老大:対OFF状態的图片、没有回復。
hbzyduwu(鞋带又松了~)老大:图片顕示位置不対。(NI的性欲是我見過最低的、hehe)
smallyear(颠狂柳絮)老大:邦我解決了問題。