mmenu没有关闭链接页面

时间:2014-08-09 00:10:53

标签: javascript jquery html css

我目前正在另一个安装了mmenu的移动网站上工作,只要滚动打开以显示菜单,所有工作都很好,但所有菜单项都是外部链接。当我点击/单击外部链接时,页面将超链接到所选页面而不先关闭菜单。无论如何在加载外部链接之前关闭菜单?

以下是代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=yes" />

<script type="text/javascript" src="../js/jquery.mmenu.min.all.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<link type="text/css" rel="stylesheet" href="../css/jquery.mmenu.all.css" />
<link type="text/css" rel="stylesheet" href="../css/main.css" />

    <script type="text/javascript">
        $(document).ready(function() {
        $("#menu").mmenu({
            classes: "mm-zoom-panels",
            counters: true
            });
        });
    </script>

</head>
<body>
    <div id="page"><a href="main.asp">
        <img border="0" src="../images/header.png" width="100%"></a>
        <div class="header">
            <a href="#menu"></a>
        </div>
        <div class="content">
        <div align="center">
    </div>
</div>
        <nav id="menu">
            <ul>
                <li><a href="main.asp">Today</a></li>
                <li><a href="times.asp">Times</a></li>
                <li><a href="setting.asp">Settings</a></li>
                <li><a href="index.asp">Log out</a></li>
            </ul>
        </nav>
    </div>
</body>

提前致谢!!

1 个答案:

答案 0 :(得分:1)

试试这段代码

$("#menu").mmenu({
    classes: "mm-zoom-panels",
    counters: true,
    onClick: {
        close: true
    }
});

有关详细信息,请参阅: - http://mmenu.frebsite.nl/documentation/options/ 感谢