下拉菜单里的头像怎么作啊!!!!!

sywj115447 2003-11-13 09:54:14
就像是QQ注册时候的那个一样,ASP能做出来吗???

如果能做出来的话,要怎么样才能做,能给个程序最好了!!!

超级加分!!!
...全文
83 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
dachangtui 2003-11-20
  • 打赏
  • 举报
回复
<head>
<style>
.selectInput{font-size:12px;color:#000000;border:2px inset;background-color:window;width:1px;cursor:default;}
.selectInput input{border-width:0;width:100px;}
.selectBtn{font-size:12px;font-family:webdings;color:red;border:2px outset;background-color:buttonface;width:1px;}
.selectContent{position:absolute;z-index:1000;border:1px solid #000000;visibility:hidden}
.tdOver{font-size:12px;padding:1 5 1 2;cursor:default;background-color:#047;color:#FFFFFF}
.tdOut{font-size:12px;padding:1 5 1 2;cursor:default;background-color:#FFFFFF;color:#000000}
.selectContent td img{border:0;width:15px;height:15px;}
</style>
</head>
<body>
<script>
/*鼠标经过时的样式*/
function doOver(e){e.className='tdOver'}
function doOut(e){e.className='tdOut'}
function doset(e){document.frm.select1.value=e.innerText}
function drop(){document.getElementById('data').style.visibility='visible'}
function document.onmouseup(){if(event.srcElement.className!='selectBtn')document.getElementById('data').style.visibility='hidden'}
function window.onload(){
var e=o=document.getElementById('edit')
var d=document.getElementById('data');
var l=e.offsetLeft;
var t=e.offsetTop;
while(e=e.offsetParent){
l+=e.offsetLeft;
t+=e.offsetTop;
}
d.style.left=l;
d.style.top=t+o.offsetHeight
}
</script>
<form name="frm">
<!--复制下列“下拉框”-->
<div class="selectInput" id='edit'>
<table cellspacing=0 cellpadding=0 width=100>
<tr>
<td><input name="select1" value="请选择"></td>
<td width=1><div class="selectBtn" onmousedown="drop();style.borderStyle='inset'" onmouseup="style.borderStyle='outset'">6</div></td>
</tr>
</table>
</div>
<!--结束-->
<!--数据部份-->
<table id="data" class='selectContent' cellspacing=0 cellpadding=0 width=120>
<tr><td class="tdOut" onmouseover="doOver(this)" onmouseout="doOut(this)" onclick="doset(this)"><img src="img/oicq.gif" align="absmiddle">可带图片下带框</td></tr>
<tr><td class="tdOut" onmouseover="doOver(this)" onmouseout="doOut(this)" onclick="doset(this)"><img src="img/oicq.gif" align="absmiddle">可输入下带框</td></tr>
<tr><td class="tdOut" onmouseover="doOver(this)" onmouseout="doOut(this)" onclick="doset(this)"><img src="img/oicq.gif" align="absmiddle">阿信原作</td></tr>
</table>
<!--结束-->
</form>

</body>

fason的作品.
一个字:强
mfkiqpl 2003-11-14
  • 打赏
  • 举报
回复
二楼的方法行得通吗?
patchclass 2003-11-14
  • 打赏
  • 举报
回复
放在表单里面一个相对的层,该层里面一个绝对的层
loulannuhai 2003-11-14
  • 打赏
  • 举报
回复
去太平洋上搜.那上面有的.

上次朋友问我我就是从哪里搜出来的.
sywj115447 2003-11-14
  • 打赏
  • 举报
回复
我还是写不出来,想了一个晚上了!!!
哪位大哥帮帮我!!!
BainStudio 2003-11-14
  • 打赏
  • 举报
回复
落上的已经很不错了.把代码拷贝过来了.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图片下拉选择器</title>
<style type="text/css">
body,td{
font-size:9pt;
}
input{
font-size:9pt;
background-color:#eeeeff;
color:#000000;
border:1px solid #0000ff;
}
</style>

</head>

<body><center>
<form name="myform" method="post" action="">请选择图片:
<div id="imgBox"></div>
<input name="myhead" type="text" id="myface" size="10" value="">
</form></center>

<script language="JavaScript">
<!--
var imgWidth=64; //The images width in the imgBox;
var imgHeight=64; //The images height in the imgBox;
var selectedNo=7; //The image's No which is eslected;
var selecteSize=2; //the count of items which be show in the list;
var imgSrc="head/数字序号.gif"; //Don't Replace "数字序号" to figure;

/************* Write images *************/
var myHTML='<SPAN onmouseover="isin=true" onmouseout="isin=false">';
myHTML+='<table width="1" onclick="showlist(this)" title="选择提示框" border="0" cellspacing="0" cellpadding="0"><tr><td><img name="imgselected" border=1 src="'+imgSrc.replace("数字序号",selectedNo)+'" WIDTH='+(imgWidth)+' HEIGHT='+imgHeight+'></td><td valign=top><img src="menu.gif"></td></tr></table>';
myHTML+='<DIV onscroll="scrollud()" id="imgBox" \n';
myHTML+='style="position:absolute;left=-800;top=0;background-color:#FFFFFF;border: 1px solid #000000;overflow-x:hidden;overflow-y:scroll; width:'+(imgWidth+20)+'px; height: '+imgHeight*selecteSize+'px">';
for(i=0;i<10;i++){
myHTML+="<img listID="+i+" src='"+imgSrc.replace("数字序号",i)+"' alt='"+imgSrc.replace("数字序号",i)+"' width="+imgWidth+" height="+imgHeight+" onclick='selectme(this)' onload='if(init)init()'><BR>";
}
myHTML+= "</DIV></SPAN>";
imgBox.outerHTML=myHTML;

/****** show or hide list *****/
function showlist(obj){
if(imgBox.style.pixelLeft!=-800){imgBox.style.pixelLeft=-800; return;}

var mytop=obj.offsetTop;
var myleft=obj.offsetLeft;
while(obj=obj.offsetParent){
myleft+=obj.offsetLeft;
mytop+=obj.offsetTop;
}
imgBox.style.left=myleft;
imgBox.style.top=mytop+imgHeight+2;

}

var isin=false;
function selectme(obj){
if(!isin||obj){imgBox.style.pixelLeft=-800;}
if(obj){
myform.myhead.value=imgSrc.replace("数字序号",obj.listID);
document.images["imgselected"].src=imgSrc.replace("数字序号",obj.listID);
}
}

/***** Scroll to appropriate position *****/
var mytime=setTimeout("",0);
var pre_X=0;
function scrollud(){
var current_X=imgBox.scrollTop;
if(current_X>pre_X && imgBox.scrollTop< Math.ceil(imgBox.scrollTop/imgHeight)*imgHeight){
clearTimeout(mytime);
mytime=setTimeout("imgBox.scrollTop=Math.round(imgBox.scrollTop+1);",1);
}
else if(current_X<pre_X && imgBox.scrollTop> Math.floor(imgBox.scrollTop/imgHeight)*imgHeight){
clearTimeout(mytime);
mytime=setTimeout("imgBox.scrollTop=Math.round(imgBox.scrollTop-1);",1);
}
pre_X=current_X;
}

function init(){
imgBox.scrollTop=selectedNo*imgHeight;
myform.myhead.value=imgSrc.replace("数字序号",selectedNo);
}

myActivation="selectme(null)";
if(document.body.onclick)
{
eval(document.body.onclick.toString().replace('anonymous()','bodyclick()'));
document.body.onclick=new Function("bodyclick();"+myActivation);
}
else document.body.onclick=new Function(myActivation);
-->
</script>

</body>
</html>
曲阿子期 2003-11-14
  • 打赏
  • 举报
回复
http://www.pconline.com.cn/pcedu/empolder/wz/javascript/10301/128166.html
sywj115447 2003-11-14
  • 打赏
  • 举报
回复
各位再想想办法,我是想在注册时用这个功能,要能提交到数据库的!!!!
能给个思路或实际代码最好了!!!!
sjjf 2003-11-13
  • 打赏
  • 举报
回复
是javascript,
难度不高,和你写一普通的代码一样,只是放在层里面而已。
sjjf 2003-11-13
  • 打赏
  • 举报
回复
层采用绝对位置
sywj115447 2003-11-13
  • 打赏
  • 举报
回复
要怎么做啊!!用JavaScript吗???可是我没写过这样的代码啊!!!
是不是响应鼠标事件时弹出一个层呀???可是我是用在表单里的,会被挡住的呀!!!
sjjf 2003-11-13
  • 打赏
  • 举报
回复
采用的欺骗方法,用层来模拟加上对鼠标事件的响应,就可以了。
jnyezhi 2003-11-13
  • 打赏
  • 举报
回复
<select name="iconlist">
<option value="1"><img src="1.gif"></option>
……
</select>

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧