<html>
<head>
<script language="javascript">
var $ = function(i) {
return document.getElementById(i)
};
function moreshow() {
var e = $('morelist');
if (e.style.display != 'block') {
e.style.display = 'block';
} else {
e.style.display = 'none';
}
return false
};
function moreddhide(e) {
if (!e) var e = window.event;
if (e.srcElement) {
var a = e.srcElement.getAttribute("id")
} else {
var a = e.target.getAttribute("id")
}
if (a != "more") {
$('morelist').style.display = 'none'
}
};
document.onclick = moreddhide;
</SCRIPT>
</head>
<body>
<a href="Javascript:" id="more" onclick="moreshow();">更多</a>
<ul id="morelist" style="border:1px solid #3366CC;list-style:none;width:50px;display:none;margin:0px;">
<li><a href="http://www.newxing.com/Code/">源码</a></li>
<li><a href="http://www.newxing.com/Tech/">教程</a></li>
<li>22222</li>
<li>333333</li>
<li>444444</li>
</ul>
</body>
</html>
Javascript实现单击"更多"链接弹出菜单选项
最新推荐文章于 2019-02-01 16:48:04 发布