QQShow?你也可以做!

<!-- 在要显示形象预览的地方放置以下这句代码 -->
<div id="bodyshow" style="border:1px solid #000000;padding:0;POSITION: relative; Left: 0px; TOP: 0px; HEIGHT: 226px; WIDTH: 140px;"></div>
<!-- 这是提交表单,把代表用户形象的字符串赋到隐藏域 userequip 提交 -->
<form name="equipform" method="post" action="">
<input name="userequip" type="hidden" value="">
<input name="saveequip" type="submit" value="保存形象" >
<input name="toreequip" type="button" value="原始形象" οnclick="shoiwit('df>df>df>0');return false;" >
</form>

<script language="JavaScript">
<!--
var myequip="df>df>df>0"; //最初显示的配置码,可由服务器读取并输出。

function shoiwit(equip){ //这个函数由配置码为参数,显示虚拟形象
showlayers=equip.split('>'); //以“>”为分隔符,分配各层图片名到一个数组 showlayers[]
str="";
for(i=0;i<showlayers.length;i++){
if(showlayers[i]!='0'&&showlayers[i]!=''){ //如果图片名为0或空值则该层不显示。
str+="<img src='http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/"+(i+1)+"/"+showlayers[i]+".gif' style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:"+(i+1)+";'>";
}
}
//最后在最上一层覆盖一幅完全透明的图片,这样用户在上面右链>另存为也只能保存这幅图了:
str+="<img src='http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/blank.gif' style='padding:0;position:absolute;top:0;left:0;width:140;height:226;z-index:100;'>";
if(equipform.userequip) equipform.userequip.value=myequip=equip; //把配置码赋值到隐藏域中
bodyshow.innerHTML=str; //显示各层图片。
}
//页面加载后先显示最初的虚拟形象:
document.body.οnlοad=new Function("shoiwit(myequip)");

function dressit(layer,img){ //这个函数用于更换配置,参数为 层数,图片名
showlayers=myequip.split('>');
newequip="";
for(i=0;i<showlayers.length;i++){
if(i+1==layer){
if(img==showlayers[i]) newequip+="df"; //如果该层已是这幅图片,则恢复为原始图片
else newequip+=img; //否则换为这幅图
}
else newequip+=showlayers[i]; //其他层图片不变
if(i+1!=showlayers.length) newequip+=">";
}
shoiwit(newequip); //显示最新配置
}

-->
</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="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/1x.gif" width="84" height="84" border="0"></a></td>
<td width="84"><a href="javascript :dressit(4,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/2x.gif" width="84" height="84" border="0"></a></td>
<td width="84"><a href="javascript :dressit(4,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/3x.gif" width="84" height="84" border="0"></a></td>
<td width="84"><a href="javascript :dressit(4,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/4/4x.gif" width="84" height="84" border="0"></a></td>
</tr>
<tr>
<td><a href="javascript :dressit(3,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/1x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(3,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/2x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(3,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/3x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(3,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/3/4x.gif" width="84" height="84" border="0"></a></td>
</tr>
<tr>
<td><a href="javascript :dressit(2,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/1x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(2,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/2x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(2,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/3x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(2,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/2/4x.gif" width="84" height="84" border="0"></a></td>
</tr>
<tr>
<td><a href="javascript :dressit(1,1)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/1x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(1,2)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/2x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(1,3)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/3x.gif" width="84" height="84" border="0"></a></td>
<td><a href="javascript :dressit(1,4)"><img src="http://www.pconline.com.cn/pcedu/redian/code_2003/equipment/1/4x.gif" width="84" height="84" border="0"></a></td>
</tr>
</table>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值