点击对象弹出DIV层菜单可以定时自动关闭

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>点击对象弹出DIV层菜单可以定时自动关闭_懒人建站收集整理-JS代码|网页图标|网页欣赏模板|SEO优化服务</title>
<meta name="keywords" content="导航菜单,焦点图片,网页特效,广告代码,SEO优化,建站技巧" />
<meta name="description" content="懒人建站只收录实用和能提高用户体验的代码,我们只想解放出你的部分写代码时间来思考更高层次的设计,而不是要你懒惰、拼凑;我们为您提供-JS代码,网页图标,网页欣赏模板,SEO优化和各种建站技巧。" />


<script type="text/javascript">
var w = 0;
var h = 0;
var mout;
function emotion(){
var oMenu = document.getElementById("menu");
if(w <= 50){
oMenu.style.display = "block";
fnLarge();
}
else{
fnSmall();
}
}
function fnLarge(){
var oMenu = document.getElementById("menu");
if(w < 200){
w += 50;
h += 25;
oMenu.style.width = w+"px";
oMenu.style.height = h+"px";
window.setTimeout("fnLarge()",10);
}
}
function fnSmall(){
var oMenu = document.getElementById("menu");
if(w > 0){
w -= 50;
h -= 25;
oMenu.style.width = w+"px";
oMenu.style.height = h+"px";
window.setTimeout("fnSmall()",5);
}
else{
oMenu.style.display = "none";
}
}
</script>
<style type="text/css">
body{
text-align: center;
}
p{
cursor: pointer;
margin: 0;
padding: 0;
font-size: 24px;
display: inline;
}
div a:link, div a:visited{
color: #666;
text-decoration: none;
}
div a:hover{
color: #FF6600;
text-decoration: underline;
}
div{
border: 2px solid #666;
background: #fff;
margin: 5px auto;
overflow: hidden;
display: none;
padding: 5px 10px;
}
ul,li{
margin: 0;
padding: 0;
}
li{
list-style: none;
width:70px;
}
li.title{
font-weight: bold;
}
</style>
</head>
<body>
<p οnclick="emotion();">点击这行文字试试!</p>
<div id="menu" οnmοuseοut="javascript:mout=setTimeout('fnSmall()',2111);" onMouseOver="javascript:clearTimeout(mout);">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80" valign="top" align="left"><ul><li class="title">ASP</li><li><a href="#" οnclick="fnSmall();">新闻</a></li><li><a href="#" οnclick="fnSmall();">论坛</a></li><li><a href="#" οnclick="fnSmall();">CMS</a></li><li></li>
</ul></td>
<td width="80" valign="top" align="left"><ul><li class="title">PHP</li><li><a href="#" οnclick="fnSmall();">文章</a></li><li><a href="#" οnclick="fnSmall();">聊天</a></li><li><a href="#" οnclick="fnSmall();">插件</a></li><li><a href="#" οnclick="fnSmall();">企业</a></li></ul></td>
<td width="80" valign="top" align="left"><ul><li class="title">JSP</li><li><a href="#" οnclick="fnSmall();">AJAX</a></li><li><a href="#" οnclick="fnSmall();">JQUERY</a></li><li><a href="#" οnclick="fnSmall();">MYSQL</a></li><li><a href="#" οnclick="fnSmall();">JAVA</a></li></ul></td>
</tr>
</table>
</div>


<!--下面只是说明与程序代码无关-->
<div style="width:95%; height:auto; display:block; margin:0 auto; margin-top:30px; font-size:10pt; line-height:150%;">
<br>
<span>本代码由<a href="http://www.51xuediannao.com" style="color:#F00;">懒人建站网 收集整理</a> </span><br>
<a href="http://www.51xuediannao.com">懒人建站 http://www.51xuediannao.com</a>
<a href="http://www.51xuediannao.com">懒人建站 == 我要学电脑</a>
</div>
</body>
</html>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值