Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
1.7k views
in Plugins by

I need all browser size always collapse menu. I use asp.net mvc 5 I'm trying since yesterday but could not figure out :( I would like to thank everyone who helped so much in advance.

 

My CODE :

<!DOCTYPE html>
<html>
<head>
    <title>Sidr Plugin with Bootstrap</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet"
          media="screen">
    <link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet">
    <!-- sidr dark theme css -->
    <link href="http://www.berriart.com/sidr/javascripts/sidr/stylesheets/jquery.sidr.dark.css"
          rel="Stylesheet" />
</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="navbar-inner">
            <div class="container">
                <button type="button" id="btnRespNav" class="btn btn-navbar" style="float: left">
                    <span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar">
                    </span>
                </button>
                <a class="brand" href="#">IMInfo.in</a>
                <div class="nav-collapse collapse">
                    <ul class="nav">
                        <li class="active"><a href="#">Home</a></li>
                        <li><a href="#">About</a></li>
                        <li><a href="#">Products</a></li>
                        <li><a href="#">Clients</a></li>
                        <li><a href="#">Contact Us</a></li>
                    </ul>
                </div>
                <!--/.nav-collapse -->
            </div>
        </div>
    </div>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.min.js"></script>
    <!-- sidr js -->
    <script src="http://www.berriart.com/sidr/javascripts/sidr/jquery.sidr.min.js"></script>
    <script type="text/javascript">

        $(document).ready(function () {
            $('.btn-navbar').sidr({
                name: 'respNav',
                source: '.nav-collapse',
            });
        });

        //this code is close sidr menu if clicked outside  {optional}
        $(document).bind("click", function () {
            $.sidr('close', 'respNav');
        });
    </script>
</body>
</html>

Please log in or register to answer this question.

...