用框架
top.frameleft.cols = "0,*";
top.frameleft.cols = "0,*";
解决方案 »
- 谁用过JQuery dataTables的帮帮忙!传值问题。
- 火狐浏览器的一个神奇的功能,我out了?求大神围观
- 图像为什么刷新一下才能显示?启动时是空白页,这是怎么回事?
- 请教大师,js传入参数的时候乱码,应该怎么解决呢
- ztree 勾选状态 问题 大家帮看下在线 谢谢了 有图有真相
- 如何在浏览器地址栏显示某个站点的地址或域名
- 如何将当前网页右击处的URL传递给应用程序?(急)
- 如何做出同windows登陆时的窗口一样的效果,可以随意拖动
- jquery怎么获取一个节点相对于祖先节点的偏移量?
- extjs中create一个window,里面一个panel加html然后加入buttons就报错了。
- 电影地址加密?
- 在一个页面中如何传递变量的值?
我想要的是能够方便的使左右,显示和隐藏。但是我想用一“最高”的层来这样完成。这样不会占左和右frame的地方。
隐藏top.document.all.fraLeftFrame.cols="1%,*";
显示top.document.all.fraLeftFrame.cols="30%,*";
{
var currdata = new Array();
var i = 0;
var printstr = "<table border='0' cellspacing='0' cellpadding='0'>";
for(; i<treedata.length; i++)
{
if(treedata[i][1]==id) currdata[currdata.length] = treedata[i];
}
for(i=0; i<currdata.length; i++)
{
if(itemExists(treedata,currdata[i][0]))
{
if(i==currdata.length-1)
{
menutype = "menu3";
listtype = "list1";
}
else
{
menutype = "menu1";
listtype = "list";
}
onmouseup = "chengstate("+currdata[i][0]+")";
menuname = currdata[i][2];
}
else
{
if(i==currdata.length-1)
{
menutype = "file1";
}
else
{
menutype = "file";
}
menuname = "<a href='"+currdata[i][3]+"' target='_blank'>"+currdata[i][2]+"</a>";
onmouseup = "";
}
printstr += "<tr><td id='pr"+currdata[i][0]+"' class="+menutype+" onMouseUp="+onmouseup+">"+menuname+"</td></tr>";
printstr += "<tr id='item"+currdata[i][0]+"' style='display:none'><td class="+listtype+">"+menu(treedata,currdata[i][0])+"</td></tr>"; }
printstr += "</table>";
return printstr;
}function itemExists(treedata,id)
{
for(var i=0;i<treedata.length;i++)
{
if(treedata[i][1]==id)return true;
}
return false;
}function chengstate(menuid,save)
{
menuobj = eval("item"+menuid);
obj = eval("pr"+menuid);
if(menuobj.style.display == '')
{
menuobj.style.display = 'none';
}else{
menuobj.style.display = '';
}//end if
switch (obj.className)
{
case "menu1":
obj.className = "menu2";
break;
case "menu2":
obj.className = "menu1";
break;
case "menu3":
obj.className = "menu4";
break;
case "menu4":
obj.className = "menu3";
break;
}
if(save!=false)
{
setupcookie(menuid);
}
}function setupcookie(menuid)
{
var menu = new Array();
var menustr = new String();
menuOpen = false;
if(checkCookieExist("menu"))
{
menustr = getCookie("menu");
if(menustr.length>0)
{
menu = menustr.split(",");
for(i=0;i<menu.length;i++)
{
if(menu[i]==menuid)
{
menu[i]='';
menuOpen = true;
}//end if
}//end for
if(menuOpen==false)menu[i] = menuid;
}else{
menu[0] = menuid;
}
}else{
menu[0] = menuid;
}
menustr = menu.join(",");
menustr = menustr.replace(",,",",");
if(menustr.substr(menustr.length-1,1)==',')menustr = menustr.substr(0,menustr.length-1);
if(menustr.substr(0,1)==',')menustr = menustr.substr(1,menustr.length-1);
saveCookie("menu",menustr,1000);
}function initialize()
{
var menu = new Array();
var menustr = new String();
if(checkCookieExist("menu"))
{
menustr = getCookie("menu");
if(menustr.length>0)
{
menu = menustr.split(",");
for(i=0;i<menu.length;i++)
{
if(objExists(menu[i]))
{
chengstate(menu[i],false);
}
}
objExists(99);
}
}
}function objExists(objid)
{
try
{
obj = eval("item"+objid);
}
catch(obj)
{
return false;
}
if(typeof(obj)=="object")
{
return true;
}
return false;
}
function saveCookie(name, value, expires, path, domain, secure)
{
var strCookie = name + "=" + value;
if (expires)
{
var curTime = new Date();
curTime.setTime(curTime.getTime() + expires*24*60*60*1000);
strCookie += "; expires=" + curTime.toGMTString();
} strCookie += (path) ? "; path=" + path : ""; strCookie += (domain) ? "; domain=" + domain : "";
strCookie += (secure) ? "; secure" : "";
document.cookie = strCookie;
}function getCookie(name)
{
var strCookies = document.cookie;
var cookieName = name + "=";
var valueBegin, valueEnd, value;
valueBegin = strCookies.indexOf(cookieName);
if (valueBegin == -1) return null;
valueEnd = strCookies.indexOf(";", valueBegin);
if (valueEnd == -1)
valueEnd = strCookies.length;
value = strCookies.substring(valueBegin+cookieName.length,valueEnd);
return value;
}function checkCookieExist(name)
{
if (getCookie(name))
return true;
else
return false;
}function deleteCookie(name, path, domain)
{
var strCookie; if (checkCookieExist(name))
{
strCookie = name + "=";
strCookie += (path) ? "; path=" + path : "";
strCookie += (domain) ? "; domain=" + domain : "";
strCookie += "; expires=Thu, 01-Jan-70 00:00:01 GMT";
document.cookie = strCookie;
}
}
.css
.menu1 {
font-size: 9pt;
background-image: url(folder1.gif);
background-repeat: no-repeat;
height: 17px;
left: 32px;
padding-left: 32px;
cursor: hand;
}
.menu2 {
font-size: 9pt;
background-image: url(folder2.gif);
background-repeat: no-repeat;
height: 17px;
left: 32px;
padding-left: 32px;
cursor: hand;
}
.menu3 {
font-size: 9pt;
background-image: url(folder3.gif);
background-repeat: no-repeat;
height: 17px;
left: 32px;
padding-left: 32px;
cursor: hand;
}
.menu4{
font-size: 9pt;
background-image: url(folder4.gif);
background-repeat: no-repeat;
height: 17px;
left: 32px;
padding-left: 32px;
cursor: hand;
}
.list{
font-size: 9pt;
padding-left: 20px;
background-image: url(list.gif);
background-repeat: repeat-y;
}
.list1{
font-size: 9pt;
padding-left: 20px;
}
.file{
font-size: 9pt;
background-image: url(file.gif);
background-repeat: no-repeat;
height: 16px;
cursor: hand;
padding-left: 32px;
}
.file1 {
font-size: 9pt;
background-image: url(file1.gif);
background-repeat: no-repeat;
height: 16px;
cursor: hand;
padding-left: 32px;
}
body {
font-size: 9pt;
color: #000000;
background-color: #FFFFFF;
}
a:link {
font-size: 9pt;
color: #000000;
text-decoration: none;
}
a:visited {
font-size: 9pt;
color: #000000;
text-decoration: none;
}
a:hover {
font-size: 9pt;
color: #0000FF;
text-decoration: none;
position: relative;
right: 1px;
bottom: 1px;
}
a:active {
font-size: 9pt;
color: #000000;
text-decoration: none;
}
.test {
font-size:9pt;
background-color:#FF0000;
}.htm
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<link href="menu.css" rel="stylesheet" type="text/css">
<script src="menu.js" type="text/javascript"></script>
</head>
<body onLoad="initialize()">
<script language="javascript">
var yematree = new Array();yematree[0] = new Array("1","0","技术文档","http://www.yemaweb.com");
yematree[1] = new Array("2","0","情感世界","http://www.yemaweb.com");
yematree[2] = new Array("3","0","未来之窗","http://www.yemaweb.com");
yematree[3] = new Array("4","1","编程语言","http://www.yemaweb.com");
yematree[4] = new Array("5","1","服务器","http://www.yemaweb.com");
yematree[5] = new Array("6","1","代码共享","http://www.yemaweb.com");
yematree[6] = new Array("7","2","那年我18","http://www.yemaweb.com");
yematree[7] = new Array("8","4","Java","http://www.yemaweb.com");
yematree[8] = new Array("9","2","不要再给我温柔","http://www.yemaweb.com");
yematree[9] = new Array("10","3","未来技术","http://www.yemaweb.com");
yematree[10] = new Array("11","4","VC++","http://www.yemaweb.com");
yematree[11] = new Array("12","3","科幻世界","http://www.yemaweb.com");
yematree[12] = new Array("13","4","VB","http://www.yemaweb.com");
yematree[13] = new Array("14","4","C#","http://www.yemaweb.com");
yematree[14] = new Array("14","4","C#","http://www.yemaweb.com");
document.write(menu(yematree,0));
</script></body>
</html>