如何让弹出式下拉菜单保持相对位置?

phoenix8122 2003-10-21 11:16:11
我把表格居中,其中有一个单元格有下拉菜单,如何设置下拉菜单的位置,保证在随意调整浏览器大小的情况下让弹出式下拉菜单保持在该单元格的下面?
...全文
119 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
phoenix8122 2003-11-10
  • 打赏
  • 举报
回复
还有谁知道啊?
phoenix8122 2003-10-29
  • 打赏
  • 举报
回复
在层里嵌层?那显示哪个层呢?
98zsh 2003-10-28
  • 打赏
  • 举报
回复
在层里嵌层!
phoenix8122 2003-10-28
  • 打赏
  • 举报
回复
看了一下,改变窗口大小时还是有部分偏移,不过幅度不大
Iamfish 2003-10-28
  • 打赏
  • 举报
回复
如果你的页面是用表格做的。那么。
你那个弹出来DIV,宽度用100%,在这个DIV中放一个表格,大小和对齐方式跟主页面的表格一样。做三个列,对齐到你的要弹出菜单的地方。

这样就搞定了。参考:

http://www.eur-point.com/那个样品列表项上。

不过,好像用TBody可以做出来(我很讨厌这个TBoby,所以没试过。)
zhanghao5188 2003-10-28
  • 打赏
  • 举报
回复
style="position:relative;xxxxxxxxxxxxxxxxxx"
phoenix8122 2003-10-24
  • 打赏
  • 举报
回复
我需要色块的左边界始终在as单元格的左边界下面,上面的代码实现起来好象还是不一样。

<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>
<body onLoad="Layer1.style.top='0';Layer1.style.left='0'">
<script language="javascript">
function openme(object){
object.style.background="#6B9ED6";
}
function closeme(object){
object.style.background="";
}

<!--
function showit(its){
if (document.all) {
obj="document.all['Layer"+its+"']";
thisobj=eval(obj);
if (its!=0) thisobj.style.visibility="visible"
} else if (document.layers) {
obj="document.layers['Layer"+its+"']";
thisobj=eval(obj);
if (its!=0) thisobj.visibility="show"
}}

function hideit(ith){
if (document.all) {
obj="document.all['Layer"+ith+"']";
thisobj=eval(obj);
thisobj.style.visibility="hidden"
} else if (document.layers) {
obj="document.layers['Layer"+ith+"']";
thisobj=eval(obj);
thisobj.visibility="hide"
}}
//-->

</script>
 <div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="50%" id="AutoNumber1">
<tr>
<td width="50%" colspan="2" height="25"> </td>
<td width="50%" colspan="2" height="25"> </td>
</tr>
<tr>
<td width="25%" height="25"> </td>
<td width="50%" colspan="2" height="25" onMouseOver="openme(this);showit(1);" onMouseOut="closeme(this);hideit(1);" >
as  </td>
<td width="25%" height="25"> </td>
</tr>
</table>
</center>
</div>
<p> </p>
<div align="center">
<center>
<table width="50%" border="1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td valign="top" >
<div id="Layer1" style="position:relative; left:300px; top:48px; width:141px; height:74px; z-index:1; background-color: #00FF00; layer-background-color: #00FF00; border: 1px none #000000;"></div>
</td>
<td> </td>
</tr>
</table>
</center>
</div>
</body>
</html>
xxrl 2003-10-24
  • 打赏
  • 举报
回复
需要ie5.5+支持。
patchclass 2003-10-24
  • 打赏
  • 举报
回复
hillhero789(丘)
的没有错啊
不要计算单元格在页面中的位置
表格里面一个relative层
该层里面套一个绝对的层就好了
jz_bnx 2003-10-22
  • 打赏
  • 举报
回复
这个比较讨厌,要计算单元格在叶面中的页面位置
hillhero789 2003-10-22
  • 打赏
  • 举报
回复
有什么问题呢?
phoenix8122 2003-10-22
  • 打赏
  • 举报
回复
好像不行啊
hillhero789 2003-10-21
  • 打赏
  • 举报
回复
<body onLoad="Layer1.style.top='0';Layer1.style.left='0'">
<table width="750" border="1" cellspacing="0" cellpadding="0">
<tr>
<td height="135" valign="top" >
<div id="Layer1" style="position:relative; left:303px; top:48px; width:141px; height:74px; z-index:1; background-color: #00FF00; layer-background-color: #00FF00; border: 1px none #000000;"></div>
</td>
<td> </td>
</tr>
</table>
</body>
mjwgtm 2003-10-21
  • 打赏
  • 举报
回复
把表格的宽设成100%

28,390

社区成员

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

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