类似于下面这个效果。按X出来按Z消失
把键值自己改改吧。<STYLE>#slidemenubar {
BORDER-RIGHT: green 1px solid; BORDER-TOP: green 1px solid; LEFT: -155px; FONT: bold 12px/20px Verdana; BORDER-LEFT: green 1px solid; WIDTH: 160px; BORDER-BOTTOM: green 1px solid; POSITION: absolute; TOP: 170px; BACKGROUND-COLOR: lightyellow; layer-background-color: lightyellow
}
#slidemenubar2 {
BORDER-RIGHT: green 1px solid; BORDER-TOP: green 1px solid; LEFT: -155px; FONT: bold 12px/20px Verdana; BORDER-LEFT: green 1px solid; WIDTH: 160px; BORDER-BOTTOM: green 1px solid; POSITION: absolute; TOP: 170px; BACKGROUND-COLOR: lightyellow; layer-background-color: lightyellow
}
</STYLE><BODY>
<layer id=slidemenubar onMouseOver=showtip(0) 
      onMouseOut=showtip(1)> 
<script language=JavaScript1.2>
function showtip(nulling){
if (document.all){
if (nulling==0&&slidemenubar2.style.pixelLeft==-150)
slidemenubar2.title='Press "x" to expand the menu, "z" to contract it'
else
slidemenubar2.title=''
}
else if (document.layers){
if (nulling==0&&!window.pullit)
window.status='Press "x" to expand the menu, "z" to contract it'
else
window.status=''
}
}
if (document.all)
document.write('<div id="slidemenubar2" style="left:-150" onMouseover="showtip(0)" onMouseout="showtip(1)">')
var sitems=new Array()
var sitemlinks=new Array()
for (I=0;I<=sitems.length-1;I++)
document.write('<a href='+sitemlinks[I]+'>'+sitems[I]+'</a><br>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers)
setTimeout("window.onresize=regenerate",400)
}
window.onload=regenerate2
if (document.all){
document.write('</div>')
themenu=document.all.slidemenubar2.style
rightboundary=0
leftboundary=-150
}
else{
themenu=document.layers.slidemenubar
rightboundary=150
leftboundary=10
}
function pull(){
if (window.drawit)
clearInterval(drawit)
pullit=setInterval("pullengine()",50)
}
function draw(){
clearInterval(pullit)
drawit=setInterval("drawengine()",50)
}
function pullengine(){
if (document.all&&themenu.pixelLeft<rightboundary)
themenu.pixelLeft+=5
else if(document.layers&&themenu.left<rightboundary)
themenu.left+=5
else if (window.pullit)
clearInterval(pullit)
}
function drawengine(){
if (document.all&&themenu.pixelLeft>leftboundary)
themenu.pixelLeft-=5
else if(document.layers&&themenu.left>leftboundary)
themenu.left-=5
else if (window.drawit)
clearInterval(drawit)
}if (document.layers)
document.captureEvents(Event.KEYPRESS)
function menuengine(e){
if (document.layers){
if (e.which==120)
pull()
if (e.which==122)
draw()
}
else if (document.all){
if (event.keyCode==120)
pull()
if (event.keyCode==122)
draw()
}
}
document.onkeypress=menuengine
</script>
</layer>
<p>单击"X"键弹出,单击"Z"键缩回</p>
</BODY>