分享
 
 
 

左侧的隐藏菜单,点击后显示下拉分级菜单的内容

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

<!-- 把如下代码加入<body>区域中 -->

<html>

<head>

<title>web reference</title>

<script language="JavaScript1.2" type="text/javascript">

var maxmnus = 5

function opTab(){

var mnu = document.getElementById("menubar")

var arrdiv = document.getElementById("arrow")

var arrtxt = document.getElementById("arr")

if((mnu.style.display != "block") || (mnu.style.display == "")){

mnu.style.display = "block"

arrdiv.style.pixelLeft = mnu.style.width.substring(0 , mnu.style.width.length - 2)

arrtxt.innerText = "3";

} else {

mnu.style.display = "none"

arrtxt.innerText = "4";

arrdiv.style.pixelLeft = 0;

}

event.cancelBubble = true;

}

function toggleMenu(el){

for(var i = 0;i < maxmnus;i++) document.getElementById(document.getElementById("c" + i).menu).style.display = "none";

if(el.status == "closed"){

el.status = "open"

document.getElementById(el.menu).style.display = "block";

} else {

el.status = "closed"

}

}

function toggleSub(e){

el = document.getElementById(e)

if(el.status == "closed"){

el.style.display = "block";

el.status = "open"

} else {

el.style.display = "none";

el.status = "closed"

}

event.cancelBubble = true;

}

</script>

<style type="text/css">

#menubar{

position:absolute;top:0px;left:0px;display:none;font-family:Verdana,Helvetica,Arial;font-weight:700;font-size:10px;cursor:hand;z-index:5;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#2644b2', endColorstr='#e7e8f1');}

.indicator{

color:#b24426;font-family:Webdings;font-weight:bold;font-size:10px;}

.r1{

position:relative;top:10px;left:5px;width:213px;color:#e7e8f1;border-left:#e7e8f1 2px outset;border-top:#e7e8f1 2px outset;border-right:#e7e8f1 2px outset;border-bottom:#e7e8f1 2px outset;padding-left:5px;padding-top:1px;adding-right:5px;padding-bottom:1px;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#2644b2', endColorstr='#e7e8f1');}

.submenu1{

position:relative;top:0px;left:0px;height:95%;width:100%;border-left:#e0f8e3 2px inset;border-top:#e0f8e3 2px inset;border-right:#e0f8e3 2px inset;border-bottom:#e0f8e3 2px inset;padding-left:3px;padding-top:3px;padding-right:3px;padding-bottom:3px;display:none;color:#2644b2;font-family:Verdana,Helvetica,Arial;font-weight:700;font-size:10px;background-color:#cff1d4;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#bec1e4', endColorstr='#e7e8f1');}

.submenu2{

position:relative;top:0px;left:0px;width:90%;border-left:#e0f8e3 3px groove;border-top:#e0f8e3 3px groove;border-right:#e0f8e3 3px groove;border-bottom:#e0f8e3 3px groove;padding-left:3px;padding-top:3px;padding-right:3px;padding-bottom:3px;margin-top:4px;display:none;background-color:#cff1d4;color:#2644b2;font-family:Verdana,Helvetica,Arial;font-weight:700;font-size:10px;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#bec1e4', endColorstr='#e7e8f1');}

.pulltab{

position:absolute;top:0px;left:0px;height:100%;width:20px;padding-left:2px;cursor:hand;color:#2644b2;font-family:Webdings;font-weight:bold;font-size:10px;z-index:5;background-image:url();background-repeat:repeat-y;filter:progid:DXImageTransform.Microsoft.gradient(enabled='true',gradientType='1',startColorstr='#e7e8f1', endColorstr='#2644b2');}

.inner{

height:100%;width:100%;}

.mtab{

position:relative;top:0px;

.btninner{

height:100%;width:100%;}

.fr{

position:absolute;top:0px;left:30px;}

</style>

</head>

<body scroll="no">

<div id="menubar" style="; HEIGHT: expression(document.body.offsetHeight); WIDTH: 223px">

<div id="c0" class="r1" onclick="toggleMenu(this)" status="closed" menu="m0">

<div id="cbtn" class="btninner">Behaviors</div>

<div class="mtab">

<table id="m0" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0">

<tr><td onclick="opTab();">DHTML Behaviours</td></tr>

<tr><td onclick="opTab();">HTC Reference</td></tr>

<tr><td onclick="opTab();">Element Behaviors</td></tr>

<tr><td onclick="toggleSub('m0s0');">ViewLink Overview<span class="indicator">6</span>

<table id="m0s0" class="submenu2" align="center" border="0" cellspacing="0" cellpadding="0" status="closed">

<tr><td onclick="opTab();">ViewLink CSS Inheritance</td></tr>

</table></td></tr>

<tr><td onclick="opTab();">Default Behaviors Reference</td></tr>

<tr><td onclick="opTab();">Behaviors Library</td></tr>

<tr><td onclick="opTab();">Using DHTML behaviors</td></tr>

<tr><td onclick="opTab();">Implementing DHTML Behaviors in Script Using HTML Components</td></tr>

</table>

</div>

</div>

<div id="c1" class="r1" onclick="toggleMenu(this)" status="closed" menu="m1">

<div id="cbtn" class="btninner">CSS</div>

<div>

<table id="m1" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0">

<tr><td onclick="opTab();">A Coast-to-Coast Cascade of Style Sheets</td></tr>

<tr><td onclick="opTab();">Using Cascading Style Sheets</td></tr>

<tr><td onclick="opTab();">Controlling Presentation with Measurement and Location Properties</td></tr>

<tr><td onclick="opTab();">A User's Guide to Style Sheets</td></tr>

<tr><td onclick="opTab();">Cascading Style Sheets in Internet Explorer 4.0</td></tr>

<tr><td onclick="opTab();">New in CSS, Level 2</td></tr>

<tr><td onclick="opTab();">CSS Positioning</td></tr>

<tr><td onclick="opTab();">Linked Style Sheets</td></tr>

<tr><td onclick="opTab();">Using Vertical Layout in Internet Explorer 5.5</td></tr>

<tr><td onclick="opTab();">CSS Attributes Reference</td></tr>

<tr><td onclick="opTab();">CSS Length Units Reference</td></tr>

<tr><td onclick="opTab();">Tips</td></tr>

</table>

</div>

</div>

<div id="c2" class="r1" onclick="toggleMenu(this)" status="closed" menu="m2">

<div id="cbtn" class="btninner">DHTML</div>

<div>

<table id="m2" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0">

<tr><td>DHTML 1</td></tr>

<tr><td>DHTML 2</td></tr>

<tr><td>DHTML 3</td></tr>

<tr><td>DHTML 4</td></tr>

<tr><td>DHTML 5</td></tr>

<tr><td>DHTML 6</td></tr>

<tr><td>DHTML 7</td></tr>

<tr><td>DHTML 8</td></tr>

<tr><td>DHTML 9</td></tr>

<tr><td>DHTML 10</td></tr>

<tr><td>DHTML 11</td></tr>

<tr><td>DHTML 12</td></tr>

</table>

</div>

</div>

<div id="c3" class="r1" onclick="toggleMenu(this)" status="closed" menu="m3">

<div id="cbtn" class="btninner">DOM</div>

<div>

<table id="m3" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0">

<tr><td>DOM 1</td></tr>

<tr><td>DOM 2</td></tr>

<tr><td>DOM 3</td></tr>

<tr><td>DOM 4</td></tr>

<tr><td>DOM 5</td></tr>

<tr><td>DOM 6</td></tr>

<tr><td>DOM 7</td></tr>

<tr><td>DOM 8</td></tr>

<tr><td>DOM 9</td></tr>

<tr><td>DOM 10</td></tr>

<tr><td>DOM 11</td></tr>

<tr><td>DOM 12</td></tr>

</table>

</div>

</div>

<div id="c4" class="r1" onclick="toggleMenu(this)" status="closed" menu="m4">

<div id="cbtn" class="btninner">HTML</div>

<div>

<table id="m4" class="submenu1" align="center" border="0" cellspacing="0" cellpadding="0">

<tr><td>HTML 1</td></tr>

<tr><td>HTML 2</td></tr>

<tr><td>HTML 3</td></tr>

<tr><td>HTML 4</td></tr>

<tr><td>HTML 5</td></tr>

<tr><td>HTML 6</td></tr>

<tr><td>HTML 7</td></tr>

<tr><td>HTML 8</td></tr>

<tr><td>HTML 9</td></tr>

<tr><td>HTML 10</td></tr>

<tr><td>HTML 11</td></tr>

<tr><td>HTML 12</td></tr>

</table>

</div>

</div>

</div>

<div id="arrow" class="pulltab" onclick="opTab()"><table class="inner"><tr><td id="arr" valign="middle">4</td></tr></table></div>

<div id="fr" name="fr" class="fr">

<h2>左侧的变化菜单</h2>

<p>This menu is specifically designed for IE5.5+, there will be a version for N6+ and Mozilla 0.9.2 soon</p>

<ol>

<li>Click on the bar to the left to open or close the menu</li>

<li>Clicking on any menu item would normally display a page here and/or show a submenu indicated by a down arrow at Jon Steele's suggestion</li>

<li>The fourth item of the "Behavoirs" menu, "Viewlink Overview" has a sub-menu.</li>

<li>No menu will remain open if another is clicked</li>

<li>Clicking on the same menu item toggles it open or closed accordingly</li>

<li>Selection of a link closes the menu automatically</li>

<li>The IE 5.5 version, uses no images, the colouration is from a behavior that requires 5.5</li>

<li>The 5.0 version uses 2 small jpg but are of lesser quality.</li>

<li>This menu is designed, primarily, for dynamic page. The adat for the page would either be placed here via XML or arrays or document/write method.

</ol>

</div>

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有