Giter VIP home page Giter VIP logo

startbootstrap-sb-admin-2-sidebar-toggle's Introduction

Sidebar Toggle for SB Admin 2

Sidebar with toggle option for sb admin 2. The required dependent startbootstrap libraries are not part of the download. All the required libraries are added using bower package manager under the folder `startbootstrap-sb-admin-2-sidebar-toggle\assets\bower'.

Getting Started

To run this demo application

  • Download the latest release the project on startbootstrap-sb-admin-2-sidebar-toggle.

  • Unzip the archive.

  • You will need to issue the below commands form the root folder of the project i.e. 'startbootstrap-sb-admin-2-sidebar-toggle' in order to run the demo.

    1. This step is must and should run successfully.

       $ bower install  		
      
    2. This step is optional. Check the step 3.

       $ python -m SimpleHTTPServer
      
    3. If you do not have python installed, simply open index.html into a browser.

Usage

Add references to required CSS and JS files

  1. startbootstrap SB Admin specific CSS and JS files. Please check here SB Admin 2

  2. sbadmin2-sidebar-toggle.css

<link href="./sbadmin2-sidebar-toggle.css" rel="stylesheet" type="text/css">

Add required HTML Markup

<div id="wrapper" class="toggled">
	<nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0">

		 <ul class="nav navbar-top-links navbar-right">
            <li>
            	<!--menu toggle button -->
                <button id="menu-toggle" type="button" data-toggle="button" class="btn btn-default btn-xs">
                    <i class="fa fa-exchange fa-fw"></i>
                </button>
            </li>
        </ul>
            

		<!-- Sidebar wrapper over SB Admin 2 sidebar -->
	 	<div id="sidebar-wrapper">

            <div class="navbar-default sidebar" role="navigation">

            	 <div class="sidebar-nav navbar-collapse">

                     <ul class="nav in" id="side-menu">
                     	
                     	 <li class="sidebar-search">

                            <a href="index.html" class="active"><i class="fa fa-dashboard fa-fw"></i> 

                            	<!-- Things to be hidden on toggled are encolsed with masked -->
                                <span class="masked">
                                    Dashboard
                                </span>    
                            </a>

	                    </li>

            		</ul>	
            </div>

        </div>

    </nav>

    <div id="page-wrapper" style="min-height: 158px;">
    </div>	
</div>    

Add some JavaScript to enable the toggle button

 <script type="text/javascript">
    $(document).ready(function() {
        $("#menu-toggle").click(function(e) {
            e.preventDefault();
            
            $("#wrapper").toggleClass("toggled");

            $('#wrapper.toggled').find("#sidebar-wrapper").find(".collapse").collapse('hide');
            
        });
    });
</script>

startbootstrap-sb-admin-2-sidebar-toggle's People

Contributors

pramod-rathod-avalara avatar yshahin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.