<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
var p, i, foundObj;
if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}</script>
<title>无标题文档</title>
<style type="text/css">
<!--
.emenu {
background-image: url(tree/sub.gif);
background-repeat: no-repeat;
padding-left: 44px;
cursor: hand;
}
.submenu {
padding-left: 24px;
}
.file {
background-image: url(tree/folder1.gif);
background-repeat: no-repeat;
padding-left: 18px;
cursor: hand;
}
-->
</style>
</head><body>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="emenu" onMouseUp="with(findObj('blueide')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">根</td>
</tr>
<tr id="blueidea">
<td class="submenu" ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="emenu" onMouseUp="with(findObj('forums')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">子目录</td>
</tr>
<tr id="forums">
<td width="200" class="submenu" ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="emenu" onMouseUp="with(findObj('lexrus')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">ddds</td>
</tr>
<tr id="lexrus">
<td class="submenu"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
</table></td>
</tr>
</table>
<br>
</body>
</html>
这是我的代码,我想让这个菜单一开始是合起来,不是展开,怎么改,谢谢
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
var p, i, foundObj;
if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}</script>
<title>无标题文档</title>
<style type="text/css">
<!--
.emenu {
background-image: url(tree/sub.gif);
background-repeat: no-repeat;
padding-left: 44px;
cursor: hand;
}
.submenu {
padding-left: 24px;
}
.file {
background-image: url(tree/folder1.gif);
background-repeat: no-repeat;
padding-left: 18px;
cursor: hand;
}
-->
</style>
</head><body>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="emenu" onMouseUp="with(findObj('blueide')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">根</td>
</tr>
<tr id="blueidea">
<td class="submenu" ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="emenu" onMouseUp="with(findObj('forums')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">子目录</td>
</tr>
<tr id="forums">
<td width="200" class="submenu" ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="emenu" onMouseUp="with(findObj('lexrus')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">ddds</td>
</tr>
<tr id="lexrus">
<td class="submenu"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
<tr>
<td class="file"> </td>
</tr>
</table></td>
</tr>
</table>
<br>
</body>
</html>
这是我的代码,我想让这个菜单一开始是合起来,不是展开,怎么改,谢谢
解决方案 »
- 求救 jquery动画同时进行问题
- 火狐3.0或以上版本调试出现script too large,请高手帮忙解决! 在线等待
- 页面中有多个table,怎样一次性指定第一个table1所有的td中的文字都使用同一个css
- 有没有更好的办法能实现改变input中内容的大小而不改变input外观的方法呢????
- 求一类正则表达式的写法
- Ext.grid.GridPanel中Ext.data.Store的json过长,不显示
- 问几个关于按钮的js应用,我是菜鸟,只要你喂我代码就谢谢了
- 以下是一个日历,请问谁会把它改成有时,分,秒,然后选择后文本框中显示yyyy-mm-dd hh:mm:ss
- 用图片作按钮,怎么实现在打开一个新窗口的同时,将当前窗口关闭?
- 急用,请大家帮忙看看,有什么办法可以解决
- 打印,无从下手!急求高手......
- 我想弹出一个新窗口后,关闭父窗口
display : block | none | inline | compact | er | inline-table | list-item | run-in | table |table-caption | table-cell | table-column | table-column-group | table-footer-group | table-header-group | table-row | table-row-group
参数:
block : CSS1 块对象的默认值。用该值为对象之后添加新行
none : CSS1 隐藏对象。与visibility属性的hidden值不同,其不为被隐藏的对象保留其物理空间
inline : CSS1 内联对象的默认值。用该值将从对象中删除行
compact : CSS2 分配对象为块对象或基于内容之上的内联对象
er : CSS2 指定内容在容器对象之前或之后。要使用此参数,对象必须和:after及:before 伪元素一起使用
inline-table : CSS2 将表格显示为无前后换行的内联对象或内联容器
list-item : CSS1 将块对象指定为列表项目。并可以添加可选项目标志
run-in : CSS2 分配对象为块对象或基于内容之上的内联对象
table : CSS2 将对象作为块元素级的表格显示
table-caption : CSS2 将对象作为表格标题显示
table-cell : CSS2 将对象作为表格单元格显示
table-column : CSS2 将对象作为表格列显示
table-column-group : CSS2 将对象作为表格列组显示
table-header-group : CSS2 将对象作为表格标题组显示
table-footer-group : CSS2 将对象作为表格脚注组显示
table-row : CSS2 将对象作为表格行显示
table-row-group : CSS2 将对象作为表格行组显示 但一般只用 document.all.divID.style.display="none" 或 document.all.divID.style.display=""
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body bgcolor="#FFFFFF">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
// Example: obj = findObj("image1");
function findObj(theObj, theDoc)
{
var p, i, foundObj;
if(!theDoc) theDoc = document;
if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
{
theDoc = parent.frames[theObj.substring(p+1)].document;
theObj = theObj.substring(0,p);
}
if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
for (i=0; !foundObj && i < theDoc.forms.length; i++)
foundObj = theDoc.forms[i][theObj];
for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)
foundObj = findObj(theObj,theDoc.layers[i].document);
if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
return foundObj;
}</script>
<title>无标题文档</title>
<style type="text/css">
<!--
.emenu {
background-image: url(tree/sub.gif);
background-repeat: no-repeat;
padding-left: 44px;
cursor: hand;
}
.submenu {
padding-left: 24px;
}
.file {
background-image: url(tree/folder1.gif);
background-repeat: no-repeat;
padding-left: 18px;
cursor: hand;
}
-->
</style>
</head><body>
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="emenu" onMouseUp="with(findObj('blueide')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">根</td>
</tr>
<tr id="blueidea">
<td class="submenu" ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="emenu" onMouseUp="with(findObj('forums')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">子目录</td>
</tr>
<tr id="forums" style="display:none"> //在此处加了个display:none
<td width="200" class="submenu" ><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="file"> 4</td>
</tr>
<tr>
<td class="file"> 5</td>
</tr>
<tr>
<td class="file"> 6</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td class="emenu" onMouseUp="with(findObj('lexrus')) if (style.display=='none'){style.display='';this.style.backgroundImage='url(sub.gif)'}else {style.display='none';this.style.backgroundImage='url(plus.gif)'}">ddds</td>
</tr>
<tr id="lexrus" style="display:none">//在此处加了个display:none
<td class="submenu"><table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="file"> 1</td>
</tr>
<tr>
<td class="file"> 2</td>
</tr>
<tr>
<td class="file"> 3</td>
</tr>
</table></td>
</tr>
</table>
<br>
</body>
</html>
</body>
</html>
<td ... style="display:none;" ...>
不过用<td>还是用<tr>好, 个人认为用<div>不错