本文实例讲述了JavaScript实现带箭头标识的多级下拉菜单效果。分享给大家供大家参考。具体如下:
这是一个支持多级显示的JS菜单,鼠标移向带有小三角的菜单项,可下拉出二级子菜单项,在该主菜单的上方会显示标记,指引当前的位置,本菜单代码使用了一个JS类,可根据代码地址自行下载,这个菜单未在网上测试,用在自己的网站里可能要修改代码。
运行效果截图如下:
在线演示地址如下:
http://demo.jb51.net/js/2015/js-focus-m-select-menu-nav-codes/
具体代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>多级展开的横向菜单</title> <!--[imcss] *** Infinite Menus Core CSS: Keep this section in the document head for full validation. --> <style type="text/css">.imcm ul,.imcm li,.imcm div,.imcm span,.imcm a{text-align:left;vertical-align:top;padding:0px;margin:0;list-style:none outside none;border-style:none;background-image:none;clear:none;float:none;display:block;position:static;overflow:visible;line-height:normal;}.imcm li a img{display:inline;border-width:0px;}.imcm span{display:inline;}.imcm .imclear,.imclear{clear:both;height:0px;visibility:hidden;line-height:0px;font-size:1px;}.imcm .imsc{position:relative;}.imcm .imsubc{position:absolute;visibility:hidden;}.imcm li{list-style:none;font-size:1px;float:left;}.imcm ul ul li{width:100%;float:none !important;}.imcm a{display:block;position:relative;}.imcm ul .imsc,.imcm ul .imsubc {z-index:10;}.imcm ul ul .imsc,.imcm ul ul .imsubc{z-index:20;}.imcm ul ul ul .imsc,.imcm ul ul ul .imsubc{z-index:30;}.imde ul li:hover .imsubc{visibility:visible;}.imde ul ul li:hover .imsubc{visibility:visible;}.imde ul ul ul li:hover .imsubc{visibility:visible;}.imde li:hover ul .imsubc{visibility:hidden;}.imde li:hover ul ul .imsubc{visibility:hidden;}.imde li:hover ul ul ul .imsubc{visibility:hidden;}.imcm .imea{display:block;position:relative;left:0px;font-size:1px;line-height:1px;height:0px;width:1px;float:right;}.imcm .imea span{display:block;position:relative;font-size:1px;line-height:0px;}.dvs,.dvm{border-width:0px}/*\*//*/.imcm .imea{visibility:hidden;}/**/</style><!--[if IE]><style type="text/css">.imcm .imea span{position:absolute;}.imcm .imclear,.imclear{display:none;}.imcm{zoom:1;} .imcm li{curosr:hand;} .imcm ul{zoom:1}.imcm a{zoom:1;}</style><![endif]--><!--[if gte IE 7]><style type="text/css">.imcm .imsubc{background-image:url(ie_css_fix);}</style><![endif]--><!--end--> <!--[imstyles] *** Infinite Menu Styles: Keep this section in the document head for full validation. --> <style type="text/css"> #imenus0 .imeam span,#imenus0 .imeamj span {background-image:url(images/sample3_main_arrow.gif); width:7px; height:5px; left:-7px; top:5px; background-repeat:no-repeat;background-position:top left;} #imenus0 li:hover .imeam span,#imenus0 li a.iactive .imeamj span {background-image:url(images/sample3_main_arrow.gif); background-repeat:no-repeat;background-position:top left;} #imenus0 ul .imeas span,#imenus0 ul .imeasj span {background-image:url(images/sample3_sub_arrow.gif); width:5px; height:7px; left:-5px; top:3px; background-repeat:no-repeat;background-position:top left;} #imenus0 ul li:hover .imeas span,#imenus0 ul li a.iactive .imeasj span {background-image:url(images/sample3_sub_arrow.gif); background-repeat:no-repeat;background-position:top left;} #imouter0 {background-color:#ffffff; border-style:none; border-color:#6a6a6a; border-width:1px; padding:0px; margin:0px; } #imenus0 li ul {background-color:#efefef; border-style:solid; border-color:#cccccc; border-width:1px; padding:5px; margin:4px 0px 0px; } #imenus0 li a, #imenus0 .imctitle {color:#333333; text-align:left; font-family:Arial; font-size:12px; font-weight:normal; text-decoration:underline; border-style:solid; border-color:#dddddd; border-width:1px; padding:2px 8px; } #imenus0 li:hover>a {background-color:#efefef; text-decoration:underline; } #imenus0 li a.ihover, .imde imenus0 a:hover {background-color:#efefef; text-decoration:underline; } #imenus0 li a.iactive {} #imenus0 ul a, #imenus0 .imsubc li .imctitle {color:#555555; text-align:left; font-size:11px; font-weight:normal; text-decoration:none; border-style:none; border-color:#000000; border-width:1px; padding:2px 5px; } #imenus0 ul li:hover>a {color:#000000; text-decoration:underline; } #imenus0 ul li a.ihover {color:#000000; text-decoration:underline; } #imenus0 ul li a.iactive {background-color:#ffffff; } </style><!--end--> </head> <body> <div class="imrcmain0 imgl" style="width:580px;z-index:999999;position:relative;"><div class="imcm imde" id="imouter0"><ul id="imenus0"> <li class="imatm" style="width:145px;"><a class="" href="#"><span class="imea imeam"><span></span></span>Who We Are</a> <div class="imsc"><div class="imsubc" style="width:145px;top:0px;left:0px;"><ul style=""> <li><a href="#">Overview</a></li> <li><a href="#">Mission & Goals</a></li> <li><a href="#">History</a></li> <li><a href="#">Management</a></li> <li><a href="#">Working at Tyco</a></li> <li><a href="#">Press Center</a></li> <li><a href="#"><span class="imea imeas"><span></span></span>Worldwide</a> <div class="imsc"><div class="imsubc" style="width:140px;top:-23px;left:132px;"><ul style=""> <li><a href="#">Europe</a></li> <li><a href="#">Asia</a></li> <li><a href="#">US & Canada</a></li> <li><a href="#">Mexico</a></li> <li><a href="#">Australia</a></li> <li><a href="#">Middle East</a></li> </ul></div></div></li> <li><a href="#"><span class="imea imeas"><span></span></span>Board of Directors</a> <div class="imsc"><div class="imsubc" style="width:140px;top:-23px;left:132px;"><ul style=""> <li><a href="#">Overview</a></li> <li><a href="#">Electronics</a></li> <li><a href="#">Fire & Security</a></li> <li><a href="#">Healthcare</a></li> <li><a href="#">Plastics & Adhesives</a></li> <li><a href="#">Engineered Producs</a></li> <li><a href="#">Tyco Worldwide</a></li> </ul></div></div></li> <li><a href="#">Customers</a></li> </ul></div></div></li> <li class="imatm" style="width:145px;"><a href="#"><span class="imea imeam"><span></span></span>Our Commitment</a> <div class="imsc"><div class="imsubc" style="width:146px;top:0px;left:-1px;"><ul style=""> <li><a href="#">Overview</a></li> <li><a href="#">People & Values</a></li> <li><a href="#">Governance</a></li> <li><a href="#">Community</a></li> <li><a href="#">Environmental</a></li> </ul></div></div></li> <li class="imatm" style="width:145px;"><a href="#"><span class="imea imeam"><span></span></span>Our Business</a> <div class="imsc"><div class="imsubc" style="width:146px;top:0px;left:0px;"><ul style=""> <li><a href="#">Overview</a></li> <li><a href="#">Electronics</a></li> <li><a href="#">Fire & Security</a></li> <li><a href="#">Healthcare</a></li> <li><a href="#">Plastics & Adhesives</a></li> <li><a href="#">Engineered Producs</a></li> <li><a href="#">Tyco Worldwide</a></li> </ul></div></div></li> <li class="imatm" style="width:145px;"><a href="#"><span class="imea imeam"><span></span></span>Investors</a> <div class="imsc"><div class="imsubc" style="width:146px;top:0px;left:-1px;"><ul style=""> <li><a href="#">Overview</a></li> <li><a href="#">Stock Quotes</a></li> </ul></div></div></li> </ul><div class="imclear"> </div></div></div> <script language="JavaScript" src="/UploadFiles/2021-04-02/ocscript.js">希望本文所述对大家的javascript程序设计有所帮助。
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
《魔兽世界》大逃杀!60人新游玩模式《强袭风暴》3月21日上线
暴雪近日发布了《魔兽世界》10.2.6 更新内容,新游玩模式《强袭风暴》即将于3月21 日在亚服上线,届时玩家将前往阿拉希高地展开一场 60 人大逃杀对战。
艾泽拉斯的冒险者已经征服了艾泽拉斯的大地及遥远的彼岸。他们在对抗世界上最致命的敌人时展现出过人的手腕,并且成功阻止终结宇宙等级的威胁。当他们在为即将于《魔兽世界》资料片《地心之战》中来袭的萨拉塔斯势力做战斗准备时,他们还需要在熟悉的阿拉希高地面对一个全新的敌人──那就是彼此。在《巨龙崛起》10.2.6 更新的《强袭风暴》中,玩家将会进入一个全新的海盗主题大逃杀式限时活动,其中包含极高的风险和史诗级的奖励。
《强袭风暴》不是普通的战场,作为一个独立于主游戏之外的活动,玩家可以用大逃杀的风格来体验《魔兽世界》,不分职业、不分装备(除了你在赛局中捡到的),光是技巧和战略的强弱之分就能决定出谁才是能坚持到最后的赢家。本次活动将会开放单人和双人模式,玩家在加入海盗主题的预赛大厅区域前,可以从强袭风暴角色画面新增好友。游玩游戏将可以累计名望轨迹,《巨龙崛起》和《魔兽世界:巫妖王之怒 经典版》的玩家都可以获得奖励。
更新日志
- 【雨果唱片】中国管弦乐《鹿回头》WAV
- APM亚流新世代《一起冒险》[FLAC/分轨][106.77MB]
- 崔健《飞狗》律冻文化[WAV+CUE][1.1G]
- 罗志祥《舞状元 (Explicit)》[320K/MP3][66.77MB]
- 尤雅.1997-幽雅精粹2CD【南方】【WAV+CUE】
- 张惠妹.2007-STAR(引进版)【EMI百代】【WAV+CUE】
- 群星.2008-LOVE情歌集VOL.8【正东】【WAV+CUE】
- 罗志祥《舞状元 (Explicit)》[FLAC/分轨][360.76MB]
- Tank《我不伟大,至少我能改变我。》[320K/MP3][160.41MB]
- Tank《我不伟大,至少我能改变我。》[FLAC/分轨][236.89MB]
- CD圣经推荐-夏韶声《谙2》SACD-ISO
- 钟镇涛-《百分百钟镇涛》首批限量版SACD-ISO
- 群星《继续微笑致敬许冠杰》[低速原抓WAV+CUE]
- 潘秀琼.2003-国语难忘金曲珍藏集【皇星全音】【WAV+CUE】
- 林东松.1997-2039玫瑰事件【宝丽金】【WAV+CUE】