html5演示6种不同的响应式图标菜单

html5演示6种不同的响应式图标菜单

本文演示了6种不同的手机菜单效果,用手机浏览器查看,效果会更好。

淘建站为您提供更多_导航菜单_分类导航_导航_菜单,在此特别感谢您对我们的支持与厚爱!

查看演示

演示不了,点击反馈

加入收藏

下载 160 次

下载资源

4 淘币

特别说明:本站资源来自网友发布分享,仅供学习与参考,请勿用于商业用途,若有侵权请联系删除(272966172@qq.com)。

导航菜单html代码 包括图标和标题

<nav id="menu" class="nav">					
    <ul>
        <li>
            <a href="http://www.sucaiq.com/">
                <span class="icon">
                    <i aria-hidden="true" class="icon-home"></i>
                </span>
                <span>首页</span>
            </a>
        </li>
        <li>
            <a href="http://www.sucaiq.com/js">
                <span class="icon"> 
                    <i aria-hidden="true" class="icon-services"></i>
                </span>
                <span>服务</span>
            </a>
        </li>
        <li>
            <a href="http://www.sucaiq.com/templates">
                <span class="icon">
                    <i aria-hidden="true" class="icon-portfolio"></i>
                </span>
                <span>文件夹</span>
            </a>
        </li>
        <li>
            <a href="http://www.sucaiq.com/php">
                <span class="icon">
                    <i aria-hidden="true" class="icon-blog"></i>
                </span>
                <span>博客</span>
            </a>
        </li>
        <li>
            <a href="http://www.sucaiq.com/help/template">
                <span class="icon">
                    <i aria-hidden="true" class="icon-team"></i>
                </span>
                <span>团队</span>
            </a>
        </li>
        <li>
            <a href="http://www.sucaiq.com/tools">
                <span class="icon">
                    <i aria-hidden="true" class="icon-contact"></i>
                </span>
                <span>联系我们</span>
            </a>
        </li>
    </ul>
</nav>
//  The function to change the class
var changeClass = function(r, className1, className2) {
    var regex = new RegExp("(?:^|\\s+)" + className1 + "(?:\\s+|$)");
    if (regex.test(r.className)) {
        r.className = r.className.replace(regex, ' ' + className2 + ' ');
    }
    else {
        r.className = r.className.replace(new RegExp("(?:^|\\s+)" + className2 + "(?:\\s+|$)"), ' ' + className1 + ' ');
    }
    return r.className;
};

//  Creating our button in JS for smaller screens
var menuElements = document.getElementById('menu');
menuElements.insertAdjacentHTML('afterBegin', '<button type="button" id="menutoggle" class="navtoogle" aria-hidden="true"><i aria-hidden="true" class="icon-menu"> </i> Menu</button>');

//  Toggle the class on click to show / hide the menu
document.getElementById('menutoggle').onclick = function() {
    changeClass(this, 'navtoogle active', 'navtoogle');
}

// http://tympanus.net/sucaiq/2013/05/08/responsive-retina-ready-menu/comment-page-2/#comment-438918
document.onclick = function(e) {
    var mobileButton = document.getElementById('menutoggle'),
            buttonStyle = mobileButton.currentStyle ? mobileButton.currentStyle.display : getComputedStyle(mobileButton, null).display;

    if (buttonStyle === 'block' && e.target !== mobileButton && new RegExp(' ' + 'active' + ' ').test(' ' + mobileButton.className + ' ')) {
        changeClass(mobileButton, 'navtoogle active', 'navtoogle');
    }
}

声明:本资料由淘建站会员提供,如转载注明来源,资料来源淘建站免费素材库:https://www.taojz.cn/texiao/740.html
html5演示6种不同的响应式图标菜单 希望对你有帮助,感谢您的支持!
  • css3文字导航鼠标悬停气泡动画特效

    css3文字导航鼠标悬停气泡动画特效

  • html5页面倾斜打开侧边菜单动画特效

    html5页面倾斜打开侧边菜单动画特效

  • Quicksand超漂亮的菜单排序效果

    Quicksand超漂亮的菜单排序效果

  • jquery导航条鼠标悬停图标导航图片文字上下翻滚

    jquery导航条鼠标悬停图标导航图片文字上下翻滚

  • jquery banner滑块导航条幻灯片轮播图片滚动

    jquery banner滑块导航条幻灯片轮播图片滚动

  • jquery bootstrap侧边隐藏响应式下拉导航菜单栏

    jquery bootstrap侧边隐藏响应式下拉导航菜单栏

  • jQuery中英文字切换导航条鼠标悬停滑动下拉二级导航菜单代码

    jQuery中英文字切换导航条鼠标悬停滑动下拉二级导航菜单代码

  • jQuery仿百度百科右侧浮动导航菜单代码

    jQuery仿百度百科右侧浮动导航菜单代码

  • 折叠侧边导航栏

    折叠侧边导航栏

  • jquery仿微软网站导航全屏下拉菜单代码

    jquery仿微软网站导航全屏下拉菜单代码

  • jQuery网站垂直导航标签tab选项卡切换代码

    jQuery网站垂直导航标签tab选项卡切换代码

  • jQuery黑色的导航下拉菜单代码

    jQuery黑色的导航下拉菜单代码

  • 留言(0)
    头像
     阿里云限量代金券,戳我领取
    1 2