制作仿“QQ秀”的虚拟形象
if(equipform.userequip) equipform.userequip.value=myequip=equip; file://把配置码赋值到隐藏域中
bodyshow.innerHTML=str; file://显示各层图片。
}
file://页面加载后先显示最初的虚拟形象:
document.body.onload=new Function("shoiwit(myequip)"); dedecms.com
function dressit(layer,img){ file://这个函数用于更换配置,参数为 层数,图片名
showlayers=myequip.split('>');
newequip="";
for(i=0;i<showlayers.length;i ){
if(i 1==layer){
if(img==showlayers[i]) newequip ="df"; file://如果该层已是这幅图片,则恢复为原始图片
else newequip =img; file://否则换为这幅图
}
else newequip =showlayers[i]; file://其他层图片不变
if(i 1!=showlayers.length) newequip =">";
}
shoiwit(newequip); file://显示最新配置
}
-->
</script> 织梦好,好织梦
<!--
以下是供选图片列表,点击一幅图则更改相应的层的这幅图片
注重链接路径,javascript:dressit(4,1) 表示第4层换上/脱下图片"1.gif",依此类推;
不过要注重若要第4层换上/脱下图片“df.gif”,则应加引号,写成 javascript:dressit(4,'df')
-->
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="84"><a href="javascript:dressit(4,1)"><img src="equipment/4/1x.gif" width="84" height="84" border="0"></a></td>
<td width="84"><a href="javascript:dressit(4,2)"><img src="equipment/4/2x.gif" width="84" height="84" border="0"></a></td>
<td width="84"><a href="javascript:dressit(4,3)"><img src="equipment/4/3x.gif" width="84" height="84" border="0"></a></td>
<td width="84"><a href="javascript:dressit(4,4)"><img src="equipment/4/4x.gif" width="84" height="84" border="0"></a></td>
</tr>
<tr>
<td><a href="javascript:dressit(3,1)"><img src="equipment/3/1x.gif" width="84" height="84" border="0"></a></td> 织梦好,好织梦
<td><a href="javascript:dressit(3,2)"><img src="equipment/3/2x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript:dressit(3,3)"><img src="equipment/3/3x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript:dressit(3,4)"><img src="equipment/3/4x.gif" width="84" height="84" border="0"></a></td>
</tr>
<tr>
<td><a href="javascript:dressit(2,1)"><img src="equipment/2/1x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript:dressit(2,2)"><img src="equipment/2/2x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript:dressit(2,3)"><img src="equipment/2/3x.gif" width="84" height="84" border="0"></a></td>
文章评论
共有位Admini5网友发表了评论 查看完整内容