<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實現單擊"更多"鏈接彈出菜單選項
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.