请问这个怎么做图片切换 用javascript响应mouse的事件就OK了!这样很方便的! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不是很明白楼主的意图,是要鼠标移动换图片吗??用ASP生成如下的代码就行了.<img src="csdn.gif" onmouseover="this.src='csdn2.gif'" onmouseout="this.src='csdn.gif'"> <html><head><meta http-equiv="Content-Language" content="zh-cn"><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>图片切换</title></head><body><script language=JavaScript><!--var bannerAD=new Array();var bannerADlink=new Array();var adNum=0;bannerAD[0]="http://www.51js.com/images/avatars/10.gif"; bannerADlink[0]="http://yule.sohu.com/2003/12/30/99/article217609933.shtml"; bannerAD[1]="http://www.51js.com/images/avatars/09.gif"; bannerADlink[1]="http://www.dxzs.com.cn"; bannerAD[2]="http://www.51js.com/images/avatars/08.gif"; bannerADlink[2]="http://www.lyzs.net/tianhe/index.htm"; bannerAD[3]="http://www.51js.com/images/avatars/07.gif"; bannerADlink[3]="http://www.lyzs.net/haomu/index.htm"; bannerAD[4]="http://www.51js.com/images/avatars/06.gif"; bannerADlink[4]="http://www.lyzs.net/liangzhi/index.htm"; var preloadedimages=new Array(); for (i=1;i<5;i++){preloadedimages[i]=new Image(); preloadedimages[i].src=bannerAD[i]; }function setTransition(){ if (document.all){ bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23); bannerADrotator.filters.revealTrans.apply(); }}function playTransition(){ if (document.all) bannerADrotator.filters.revealTrans.play()}function nextAd(){ if(adNum<bannerAD.length-1)adNum++ ; else adNum=0; setTransition(); document.images.bannerADrotator.src=bannerAD[adNum]; playTransition(); theTimer=setTimeout("nextAd()", 6000);}function jump2url(){ jumpUrl=bannerADlink[adNum]; jumpTarget='_blank'; if (jumpUrl != ''){ if (jumpTarget != '')window.open(jumpUrl,jumpTarget); else location.href=jumpUrl; }}function displayStatusMsg() { status=bannerADlink[adNum]; document.returnValue = true;}//--></script> <table cellpadding=0 cellspacing=0 width=111> <tr> <td colspan=3 height=1 bgcolor=#ffffff><img src=c.gif width=1 height=1></td> </tr> <tr> <td bgcolor=#ffffff width="2"><img src=c.gif width=1 height=1></td> <td width="109"><a href="javascript:jump2url()"><img style="FILTER: revealTrans(duration=2,transition=20)" height=100 src="javascript:nextAd()" width=100 border=0 name=bannerADrotator></a></td> </tr> <tr> <td colspan=3 height=1 bgcolor=#ffffff><img src=c.gif width=1 height=1></td> </tr> </table></body></html> <SCRIPT>function doFilter (){ filterFrom.filters.item(0).Apply(); // 12 is the dissolve filter. filterFrom.filters.item(0).Transition=12; imageFrom.style.visibility = "hidden"; filterTo.style.visibility = ""; filterFrom.filters.item(0).play(14); }</SCRIPT></HEAD><BODY>Click on the image to start the filter.<BR>// Call the function.<DIV ID="filterFrom" onClick="doFilter()" STYLE="position:absolute; width:200px; height:250px; background-color:white; filter:revealTrans()"> <IMG ID="imageFrom" STYLE="position:absolute; top:20px; left:20px;" SRC="http://be10.ods.org/51js/images/avatars/0101.gif"> <DIV ID="filterTo" STYLE="position:absolute; width:200px; height:250px; top:20px; left:20px; background:white; visibility:hidden;"> </DIV> </DIV> /*切换图片程序*/var imageName = 1;var flag = true;function loadimg() { if (imageName == 22) { flag = false; } else if (imageName == 1) { flag = true; } if (flag) { eval("document.all.cimg.src = 'images/login%203/images/change/login_04_"+imageName+".png'"); imageName++; } else { imageName--; eval("document.all.cimg.src = 'images/login%203/images/change/login_04_"+imageName+".png'"); }}/**/ <area shape="circle" coords="896,19,9" href="#" onClick="loadimg()"> <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> jquery似乎总是加载失败 Jquery-easyUI treegrid 异步加载问题 用jquery取元素属性问题 如何在页面加载完成后自动调用JSON javascript取值并自动输出成文本【求助】 js设置css的问题 关于动态增加文本框的问题 WScript.Shell 能改为标记为安全吗 怎么用javascript对网页的内容进行打印??????????? 简单的问题?解决了就给分啊 简单的下拉菜单问题,谁帮我解决我愿意开帖再加200分!!!!! 用showModalDialog打开一个子窗口,如何改变父窗口的url.
是要鼠标移动换图片吗??用ASP生成如下的代码就行了.
<img src="csdn.gif" onmouseover="this.src='csdn2.gif'" onmouseout="this.src='csdn.gif'">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图片切换</title>
</head><body>
<script language=JavaScript>
<!--
var bannerAD=new Array();
var bannerADlink=new Array();
var adNum=0;
bannerAD[0]="http://www.51js.com/images/avatars/10.gif";
bannerADlink[0]="http://yule.sohu.com/2003/12/30/99/article217609933.shtml";
bannerAD[1]="http://www.51js.com/images/avatars/09.gif";
bannerADlink[1]="http://www.dxzs.com.cn";
bannerAD[2]="http://www.51js.com/images/avatars/08.gif";
bannerADlink[2]="http://www.lyzs.net/tianhe/index.htm";
bannerAD[3]="http://www.51js.com/images/avatars/07.gif";
bannerADlink[3]="http://www.lyzs.net/haomu/index.htm";
bannerAD[4]="http://www.51js.com/images/avatars/06.gif";
bannerADlink[4]="http://www.lyzs.net/liangzhi/index.htm";
var preloadedimages=new Array();
for (i=1;i<5;i++){
preloadedimages[i]=new Image();
preloadedimages[i].src=bannerAD[i];
}function setTransition(){
if (document.all){
bannerADrotator.filters.revealTrans.Transition=Math.floor(Math.random()*23);
bannerADrotator.filters.revealTrans.apply();
}
}function playTransition(){
if (document.all)
bannerADrotator.filters.revealTrans.play()
}function nextAd(){
if(adNum<bannerAD.length-1)adNum++ ;
else adNum=0;
setTransition();
document.images.bannerADrotator.src=bannerAD[adNum];
playTransition();
theTimer=setTimeout("nextAd()", 6000);
}function jump2url(){
jumpUrl=bannerADlink[adNum];
jumpTarget='_blank';
if (jumpUrl != ''){
if (jumpTarget != '')window.open(jumpUrl,jumpTarget);
else location.href=jumpUrl;
}
}
function displayStatusMsg() {
status=bannerADlink[adNum];
document.returnValue = true;
}
//-->
</script>
<table cellpadding=0 cellspacing=0 width=111>
<tr>
<td colspan=3 height=1 bgcolor=#ffffff>
<img src=c.gif width=1 height=1></td>
</tr>
<tr>
<td bgcolor=#ffffff width="2"><img src=c.gif width=1 height=1></td>
<td width="109"><a
href="javascript:jump2url()"><img
style="FILTER: revealTrans(duration=2,transition=20)" height=100
src="javascript:nextAd()" width=100 border=0
name=bannerADrotator></a></td>
</tr>
<tr>
<td colspan=3 height=1 bgcolor=#ffffff>
<img src=c.gif width=1 height=1></td>
</tr>
</table>
</body></html>
function doFilter ()
{
filterFrom.filters.item(0).Apply();
// 12 is the dissolve filter.
filterFrom.filters.item(0).Transition=12;
imageFrom.style.visibility = "hidden";
filterTo.style.visibility = "";
filterFrom.filters.item(0).play(14);
}
</SCRIPT>
</HEAD>
<BODY>
Click on the image to start the filter.<BR>
// Call the function.
<DIV ID="filterFrom" onClick="doFilter()"
STYLE="position:absolute;
width:200px;
height:250px;
background-color:white;
filter:revealTrans()">
<IMG ID="imageFrom"
STYLE="position:absolute;
top:20px;
left:20px;"
SRC="http://be10.ods.org/51js/images/avatars/0101.gif">
<DIV ID="filterTo"
STYLE="position:absolute;
width:200px;
height:250px;
top:20px;
left:20px;
background:white;
visibility:hidden;">
</DIV>
</DIV>
var imageName = 1;
var flag = true;
function loadimg() {
if (imageName == 22)
{
flag = false;
}
else if (imageName == 1)
{
flag = true;
} if (flag)
{
eval("document.all.cimg.src = 'images/login%203/images/change/login_04_"+imageName+".png'");
imageName++;
}
else
{
imageName--;
eval("document.all.cimg.src = 'images/login%203/images/change/login_04_"+imageName+".png'");
}}
/**/ <area shape="circle" coords="896,19,9" href="#" onClick="loadimg()">
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>