下拉列表选择图象-鼠标事件特效代码 [ 网站地图 ]

发表于:2009-12-21 浏览:57 作者: 来源:互联网

关键字:鼠标事件

描述:<html> <head> <title>模拟OICQ下拉头像</title> <metahttp-equiv="Content-Type"content="text/html;charset=gb2312"> <scriptlanguage="javascript"> //提供者

<html>

<head>

<title>模拟OICQ下拉头像</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<script language="javascript">

//提供者:小白

//联系方法:

//qq:14681571

//email:xiaobai@17560.net

//说明:

//在网上看到一篇模拟oicq选择图象的文章

//不过程序只是给了提了个方法,并没达到真正的实际运用效果:不能选。

//小白给完善了,下面是完整的源代码

//通过测试:win2ks

//准备6张图片:文件名分别见下面的代码

//其中:http://www.mb5u.com/images/logo.gif为没选择时的图片

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="http://www.mb5u.com/images/logo.gif"  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=‘http://www.mb5u.com/images/logo.gif‘ width=70 height=70 onclick=‘javascript:select(this)‘>

 

   <img src="http://www.mb5u.com/img/200406301.jpg" width=70 height=70  onclick="javascript:select(this)">

 

<img src="http://www.mb5u.com/img/200406302.jpg" width=70 height=70  onclick="javascript:select(this)">

 

<img src="http://www.mb5u.com/img/200406303.jpg" width=70 height=70  onclick="javascript:select(this)">

 

<img src="http://www.mb5u.com/img/200406304.jpg" width=70 height=70  onclick="javascript:select(this)">

 

<img src="http://www.mb5u.com/img/200406305.jpg" width=70 height=70  onclick="javascript:select(this)">

 

</div></td>

 </tr>

</table> 

</body>

</html>


站长资讯网 做中国最丰富的资讯网站 沪ICP备05004089号