当前位置导航:炫浪网>>网络学院>>网页制作>>ASP教程

模拟QQ的下拉列表选择图象

  <html>
<head>
<title>模拟OICQ下拉头像</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
//提供者:小白
//联系方法:
//qq:14681571
//email:[email protected]
//说明:
//在网上看到一篇模拟oicq选择图象的文章
//不过程序只是给了提了个方法,并没达到真正的实际运用效果:不能选。
//小白给完善了,下面是完整的源代码
//通过测试:win2ks
//准备6张图片:文件名分别见下面的代码
//其中:none.bmp为没选择时的图片
var bV=parseInt(navigator.appVersion);
var IE4=((document.all)&&(bV>=4))?true:false;
var NS4=(document.layers)?true:false;
var z=0;
function LayerV(LayerName,V){
    E=eval('document.'+LayerName);
    if(IE4) E=eval('document.all.'+LayerName+'.style');
    E.visibility=(V?'visible':'hidden');
}

//////////////////////////////////////////////////////////
//下面这个函数实现了当点击图片时,把图片选上
function select(image1){
var html,url1
url1=image1.src

html="<img src="+url1+" width=70 height=70 onclick='javascript:select(this)'>"
html=html+"<a href=javascript:LayerV('Zhong',z=1-z)><font style='font-family: Webdings;'>6</font></a>"
pic.innerHTML=html
LayerV('Zhong',z=1-z)
}
///////////////////////////////////////////////
</script>
</head>

<body bgcolor="#FFFFFF">

<table width="90" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td>
      <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#FF66FF">
        <tr>
          <td align="right"><font style="font-size:12px"><div id=pic><img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055487914.bmp""  width=70 height=70 onclick="javascript:LayerV('Zhong',z=1-z)"><a href="javascript:LayerV('Zhong',z=1-z)"><font style="font-family: Webdings;">6</font></a></div></td>
        </tr>
      </table>
      </td>
  </tr>
  <tr>
    <td><div id="Zhong" style="position:relative ;visibility:hidden ;width:90px ;height:150px ;overflow:scroll;">
    <img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055485694.bmp" width=70 height=70 onclick='javascript:select(this)'><br>
    <img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055485918.gif?http://www.xvna.com"" width=70 height=70  onclick="javascript:select(this)"><br>
<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055425439.gif?http://www.xvna.com"" width=70 height=70  onclick="javascript:select(this)"><br>
<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055432848.gif?http://www.xvna.com"" width=70 height=70  onclick="javascript:select(this)"><br>
<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055415095.gif?http://www.xvna.com"" width=70 height=70  onclick="javascript:select(this)"><br>
<img src="/Files/BeyondPic/jcwcj/2005-12/10/05121001055421393.gif?http://www.xvna.com"" width=70 height=70  onclick="javascript:select(this)"><br>
</div></td>
  </tr>
</table>
<br><br><br><br><br><br><br><br><br>
</body>
</html>




 
相关内容
赞助商链接