您好,登錄后才能下訂單哦!
本文實(shí)例為大家分享了layui水平導(dǎo)航菜單的具體代碼,供大家參考,具體內(nèi)容如下
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>導(dǎo)航與面包屑</title> <link rel="stylesheet" href="layui/css/layui.css"> </head> <body> <fieldset class="layui-elem-field layui-field-title"> <legend>水平導(dǎo)航菜單</legend> </fieldset> <ul class="layui-nav"> <li class="layui-nav-item"><a href="">最新活動</a></li> <li class="layui-nav-item layui-this"> <a href="javascript:;">產(chǎn)品</a> <dl class="layui-nav-child"> <dd><a href="">選項(xiàng)1</a></dd> <dd><a href="">選項(xiàng)2</a></dd> <dd><a href="">選項(xiàng)3</a></dd> </dl> </li> <li class="layui-nav-item"><a href="">大數(shù)據(jù)</a></li> <li class="layui-nav-item"> <a href="javascript:;">解決方案</a> <dl class="layui-nav-child"> <dd><a href="">移動模塊</a></dd> <dd><a href="">后臺模版</a></dd> <dd class="layui-this"><a href="">選中項(xiàng)</a></dd> <dd><a href="">電商平臺</a></dd> </dl> </li> <li class="layui-nav-item"><a href="">社區(qū)</a></li> </ul> <fieldset class="layui-elem-field layui-field-title" > <legend>垂直導(dǎo)航菜單</legend> </fieldset> <ul class="layui-nav layui-nav-tree" lay-filter="demo"> <li class="layui-nav-item layui-nav-itemed"> <a href="javascript:;">默認(rèn)展開</a> <dl class="layui-nav-child"> <dd><a href="javascript:;">選項(xiàng)一</a></dd> <dd><a href="javascript:;">選項(xiàng)二</a></dd> <dd><a href="javascript:;">選項(xiàng)三</a></dd> <dd><a href="">跳轉(zhuǎn)項(xiàng)</a></dd> </dl> </li> <li class="layui-nav-item"> <a href="javascript:;">解決方案</a> <dl class="layui-nav-child"> <dd><a href="">移動模塊</a></dd> <dd><a href="">后臺模版</a></dd> <dd><a href="">電商平臺</a></dd> </dl> </li> <li class="layui-nav-item"><a href="">云市場</a></li> <li class="layui-nav-item"><a href="">社區(qū)</a></li> </ul> <fieldset class="layui-elem-field layui-field-title" > <legend>側(cè)邊固定導(dǎo)航菜單</legend> </fieldset> <ul class="layui-nav layui-nav-tree site-demo-nav" lay-filter="demo"> <li class="layui-nav-item layui-nav-itemed"> <a href="javascript:;">默認(rèn)展開</a> <dl class="layui-nav-child"> <dd><a href="javascript:;">選項(xiàng)一</a></dd> <dd><a href="javascript:;">選項(xiàng)二</a></dd> <dd><a href="javascript:;">選項(xiàng)三</a></dd> <dd><a href="">跳轉(zhuǎn)項(xiàng)</a></dd> </dl> </li> <li class="layui-nav-item"> <a href="javascript:;">解決方案</a> <dl class="layui-nav-child"> <dd><a href="">移動模塊</a></dd> <dd><a href="">后臺模版</a></dd> <dd><a href="">電商平臺</a></dd> </dl> </li> <li class="layui-nav-item"><a href="">云市場</a></li> <li class="layui-nav-item"><a href="">社區(qū)</a></li> </ul> <fieldset class="layui-elem-field layui-field-title" > <legend>默認(rèn)面包屑</legend> </fieldset> <span class="layui-breadcrumb"> <a href="/">首頁</a> <a href="/demo/">演示</a> <a><cite>導(dǎo)航元素</cite></a> </span> <fieldset class="layui-elem-field layui-field-title" > <legend>自定義分隔符的面包屑</legend> </fieldset> <span class="layui-breadcrumb" lay-separator="—"> <a href="">首頁</a> <a href="">國際新聞</a> <a href="">亞太地區(qū)</a> <a><cite>正文</cite></a> </span> <fieldset class="layui-elem-field layui-field-title" > <legend>還可以用于門戶頻道的面包屑</legend> </fieldset> <span class="layui-breadcrumb" lay-separator="|"> <a href="">娛樂</a> <a href="">八卦</a> <a href="">體育</a> <a href="">搞笑</a> <a href="">視頻</a> <a href="">游戲</a> <a href="">綜藝</a> </span> <script src="layui/layui.js" charset="utf-8"></script> <script> layui.use('element', function(){ var element = layui.element(); //導(dǎo)航的hover效果、二級菜單等功能,需要依賴element模塊 //監(jiān)聽導(dǎo)航點(diǎn)擊 element.on('nav(demo)', function(elem){ //console.log(elem) layer.msg(elem.text()); }); }); </script> </body> </html>
效果圖:
官網(wǎng)導(dǎo)航欄
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持億速云。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。