·您的位置: 首页 » 资源教程 » 编程开发 » JavaScript » 24、推拉门式菜单

24、推拉门式菜单

类别: JavaScript教程  评论数:0 总得分:0
====1、将以下代码加入到HEML的<head></head>之间:

<style type="text/css">
<!--.link {
color : #000000;
text-decoration : none;
}A.link:hover {
color : red;
}A.link:active {
color : #000000;
text-decoration : none;
}//-->
</style>
<style type="text/css">
<!--
#slidemenubar2{position:absolute;left:-110pt;width:120pt;top:100pt;border:1.5pt solid black;
background-color:#ffffff;layer-background-color:#ffffff;font: 9pt/20pt "宋体";}
body { font-size: 9pt; margin: 0pt}
#slidemenubar { position:absolute;
left:-110pt;width:120pt;top:100pt;border:1.5pt black solid;background-color:#F3F3F3;layer-background-color:lightyellow;
font: 9pt/20pt "宋体"; }
//-->
</style>

====2、将以下代码加入到HEML的<body></body>之间:

<script language="JavaScript1.2">
if (document.all)
document.write(\'<div id="slidemenubar2" style="left:-100" onMouseover="pull()" onMouseout="draw()">\')
</script> <layer id="slidemenubar" onMouseover="pull()" onMouseout="draw()"> <script language="JavaScript1.2">
var sitems=new Array()
var sitemlinks=new Array()
//以下是菜单内容,自由设置;
sitems[0]="本站首页"
sitems[1]="最新更新"
sitems[2]="超酷项目"
sitems[3]="其它栏目"
sitems[4]="桌面壁纸"
sitems[5]="给我留言"
sitems[6]="下载特区"
sitems[7]="Email Me"
sitems[8]="我的简介"
//菜单项目连接
sitemlinks[0]="链接"
sitemlinks[1]="链接"
sitemlinks[2]="链接"
sitemlinks[3]="链接"
sitemlinks[4]="链接"
sitemlinks[5]="链接"
sitemlinks[6]="链接"
sitemlinks[7]="MAIL"
sitemlinks[8]="链接"
for (i=0;i<=sitems.length-1;i++)
document.write(\'<a href=\'+sitemlinks[i]+\'>\'+sitems[i]+\'</a><br>\')
</script> </layer>
<script language="JavaScript1.2">
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)
}</script>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1