下拉菜单怎么做?不想用层!

bigspook 2004-01-04 04:59:16
不想用DW中显示/隐藏层的办法,因为层不太好确定其位置,请大家帮忙!
...全文
39 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
heroqxn 2004-01-16
  • 打赏
  • 举报
回复
用Popup object(IE5.5+)不会被任何东西覆盖

关于定位,我想可以在每次Show的时候通过offsetLeft,offsetTop来取得参照物的位置然后定位

http://msdn.microsoft.com/workshop/samples/author/dhtml/popup/usingpopup.htm
http://msdn.microsoft.com/workshop/author/om/popup_overview.asp
littleboys 2004-01-16
  • 打赏
  • 举报
回复
http://javascript.cooldev.com/ 里面的coolmenu
nik_Amis 2004-01-16
  • 打赏
  • 举报
回复
up
gooddot 2004-01-16
  • 打赏
  • 举报
回复
我觉得还是用帧好
用帧来做导航条
页面a调用页面b

页面 a :
<HTML><HEAD><TITLE>page a</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
</HEAD>
<BODY topMargin=0 marginheight="20">

<SCRIPT language=JavaScript>
<!--
function MM_findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_showHideLayers() {
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3)
if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style;v=(v=='show')?'visible':(v='hide')?'hidden':v;

}
obj.visibility=v;
}

}
//-->
</SCRIPT>

<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width=115 align=center border=0>
<TBODY>
<TR>
<TD onmouseover="MM_showHideLayers('news','','show');"
onmouseout="MM_showHideLayers('news','','hide')" width="71"><a href="http://sina.com">sina.com</a></TD>
<TD width="44"></TD>
</TR>
<TR>
<TD width="113" colspan="2">
<DIV id=news onmouseover="MM_showHideLayers('news','','show')"
style="BORDER-RIGHT: #000000 1px; BORDER-TOP: #000000 0px; Z-INDEX: 1; VISIBILITY: hidden; BORDER-LEFT: #000000 1px; WIDTH: 110px; BORDER-BOTTOM: #000000 1px; POSITION: absolute; BACKGROUND-COLOR: #333399; layer-background-color: #4070b0"
onmouseout="MM_showHideLayers('news','','hide')">
<IFRAME src="b.htm" frameBorder=0 width="100%" scrolling=no height=50></IFRAME>
</DIV>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
</BODY></HTML>


页面 b:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>page B</title>
</head>

<BODY bgColor=#333399 leftMargin=0 topMargin=0>
<TABLE borderColor=#000000 cellSpacing=0 borderColorDark=#ffffff cellPadding=2
width="100%" borderColorLight=#808080 border=1>
<TBODY>
<TR>
<TD onmouseover="javascript:this.bgColor='#000000'" onmouseout="javascript:this.bgColor='#333399'"> 
<A href="http://www.sina.com.cn" target=_parent><font color="#FFFFFF">新浪</font></A>
</TD>
</TR>
<TR>
<TD onmouseover="javascript:this.bgColor='#000000'" onmouseout="javascript:this.bgColor='#333399'"> 
<A href="http://www.163.com" target=_parent><font color="#FFFFFF">网易</font></A>
</TD>
</TR>
</TBODY></TABLE></BODY>

</html>

要插入更多列只需更改页面 a 中帧的属性就可以了
luckweb 2004-01-16
  • 打赏
  • 举报
回复
下拉菜单不是一个控件吗?
你是不是想实现带输入功能?
http://www.csdn.net/Develop/article/21/21280.shtm
http://fason.nease.net/temp/combox.htm


87,922

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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