国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

js 單擊式的下拉菜單效果實例

2019-11-20 22:25:02
字體:
來源:轉載
供稿:網友

復制代碼 代碼如下:

<!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>js 單擊式的下拉菜單效果</title>
<style>
.div1 { width: 120px; height: 20px; line-height:20px; text-align:center; }
.div2 {width: 120px; position:absolute; left:0; top:10px;visibility:hidden; }
.div2 a{ display:block;}
</style>
</head>
<body>
<script language="JavaScript">
var zindex=100
function dropit2(whichone){
if (window.themenu&&themenu.id!=whichone.id)
themenu.style.visibility="hidden"
themenu=whichone
if (document.all){
themenu.style.left=document.body.scrollLeft+event.clientX-event.offsetX
themenu.style.top=document.body.scrollTop+event.clientY-event.offsetY+18
if (themenu.style.visibility=="hidden"){
themenu.style.visibility="visible"
themenu.style.zIndex=zindex++}
else{
hidemenu()}}}
function dropit(e,whichone){
if (window.themenu&&themenu.id!=eval(whichone).id)
themenu.visibility="hide"
themenu=eval(whichone)
if (themenu.visibility=="hide")
themenu.visibility="show"
else
themenu.visibility="hide"
themenu.zIndex++
themenu.left=e.pageX-e.layerX
themenu.top=e.pageY-e.layerY+19
return false}
function hidemenu(whichone){
if (window.themenu)
themenu.style.visibility="hidden"}
function hidemenu2(){
themenu.visibility="hide"}
if (document.all)
document.onclick=hidemenu
</script>
<span class="div1" onClick="dropit2(dropmenu);event.cancelBubble=true;return false"> <a href="###" onClick="if(document.layers) return dropit(event, 'document.dropmenu')">[點擊顯示菜單]</a> </span>
<div class="div2" id="dropmenu">
<a href="http://www.survivalescaperooms.com">武林網</a>

<a href="#">個性名字網</a>
<a href="#">個性名字網</a>
</div>
</body>
</html> </td>
   </tr>
 </table>

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 高陵县| 广元市| 五家渠市| 东乡族自治县| 大关县| 唐山市| 佛坪县| 枝江市| 东乡族自治县| 贡山| 绥德县| 肥乡县| 怀安县| 静安区| 嘉义市| 治县。| 改则县| 阳朔县| 紫金县| 沈丘县| 徐汇区| 天等县| 康保县| 栖霞市| 开封县| 阿鲁科尔沁旗| 修文县| 左云县| 黄大仙区| 泗洪县| 县级市| 巨鹿县| 开阳县| 武鸣县| 广德县| 南安市| 林州市| 嘉荫县| 台湾省| 论坛| 延吉市|