UNPKG

bootstrap-layout

Version:

Bootstrap layout with sidebar navigation, sidebar skins, sidebar transition, custom scrollbars, sidebar menus and other advanced features and utilities

48 lines (46 loc) 1.43 kB
<h3>SidebarToggle.init</h3> <blockquote> Add sidebar toggle functionality to any DOM element. Useful when creating sidebar toggle buttons dynamically via JavaScript. The element requires the <code>data-target="#sidebar-id"</code> attribute. </blockquote> {% markdown %} ```js BootstrapLayout.sidebarToggle.init(element) ``` {% endmarkdown %} <div class="table-responsive"> <table class="table table-sm"> <thead> <tr> <th width="160">Argument</th> <th>Type</th> <th class="text-xs-center">Required</th> <th class="text-xs-center" width="160">Default value</th> </tr> </thead> <tbody> <tr> <td>element</td> <td> <code>String|jQuery</code><br> The argument can be a String representing a DOM selector, for example <code>#special-toggle-button</code> or a jQuery element i.e. <code>$('#special-toggle-button')</code> </td> <td class="text-xs-center"><span class="material-icons text-success">check</span></td> <td class="text-xs-center"><span class="material-icons">close</span></td> </tr> </tbody> </table> </div> <h5>Example</h5> {% markdown %} ```html <!-- A custom sidebar toggle button --> <button id="special-toggle-button" data-target="#my-sidebar"> Toggle sidebar </button> ``` ```js // JavaScript BootstrapLayout.sidebarToggle.init('#special-toggle-button') ``` {% endmarkdown %}