<img src="images/newtop2_02.gif" onclick="this.src='images/newtop2_02.gif'?this.src='images/newtop1_02.gif':this.src='images/newtop2_02.gif'" id="image2"/>
点击第一次还可以换 第二次就不可换了 汗颜啊
像
http://www.ponpa.com/index.php上那样 点击换图片 点击其他的按钮的时候 其他的恢复原状
怎么做的请教了 请大家帮帮忙
点击第一次还可以换 第二次就不可换了 汗颜啊
像
http://www.ponpa.com/index.php上那样 点击换图片 点击其他的按钮的时候 其他的恢复原状
怎么做的请教了 请大家帮帮忙
解决方案 »
- 请问MSDN的.net framework 3.5示例程序在哪里下载???
- asp.net网站上传服务器。数据库连接出错
- 动态sql问题传参求解
- 关于客户端下载的问题
- 刚学APS。NET,请问在新建工程里面为什么总是说没侦测到asp.net1.1的版本,所以无法新建?
- 关于IBuySpy的迷惑?!?!
- 裁减string的第1个字符,怎么处理?
- 如何获取dataset里面的信息
- 如何才能使datagrid中的property builder可以绑定dataset
- 欢迎测试SQL SERVER+ASP.NET+XML建立的高性能的无刷新聊天程序
- 在Firefox下如何隐藏table列
- 请教有个像空格又不是空格的空字符是啥东西,怎么打出来的
【this.src='images/newtop2_02.gif'】改成【this.src=='images/newtop2_02.gif'】
<tr style="background-color:#f00000" onclick="doselect(1);">
<td ><img id="img1" src="images/newtop2_02.gif" ></td>
<td >测试</td>
<td >test</td>
</tr>
</table>
<script language=javascript>
function doselect(idx){
var obj=document.getElementById("img"+idx);
var imgsrc=obj.src.split("/");
if(imgsrc[imgsrc.length-1]=="newtop2_02.gif") imgsrc[imgsrc.length-1]="newtop1_02.gif";
else imgsrc[imgsrc.length-1]="newtop2_02.gif";
obj.src=imgsrc.join("/");
alert(obj.src);
}
</script>
<SCRIPT LANGUAGE="JavaScript">
var imgArr=new Array();
imgArr[0]="http://avatar.profile.csdn.net/3/8/7/2_wx8849.jpg";
imgArr[1]="http://avatar.profile.csdn.net/1/8/D/2_tangling365936812.jpg";
imgArr[2]="http://c.csdn.net/bbs/t/5/i/pic_logo.gif";
function a(o){
var index=o.getAttribute("index");
if(index>-1 && index+1<imgArr.length){
o.src=imgArr[index+1]
o.setAttribute("index",index+1);
}
else{
o.src=imgArr[0];
o.setAttribute("index",0);
}
}
</SCRIPT><img src="http://avatar.profile.csdn.net/3/8/7/2_wx8849.jpg" onclick="a(this)"/>
var img_list=new Array("c:\\1.jpg","c:\\2.jpg");
function next_img(){
img_idx++;
img_idx%=img_list.length;
img_list[img_idx];
this.src=img_list[img_idx];
}
<Script>
function show()
{
if(document.getElementById("image2").src='images/newtop2_02.gif')
{
document.getElementById("image2").src='images/newtop1_02.gif'
}
else
{
document.getElementById("image2").src='images/newtop2_02.gif'
}
}
</Script>
<img src="images/newtop2_02.gif" onclick="show()" id="image2"/>