71479

Responsive Bootstrap Push Menu

Question:

i m trying to create Responsive Bootstrap Push Menu , i have created this templete and this for computer <img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/LAJ2s.png" data-original="https://i.stack.imgur.com/LAJ2s.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

and for mobile it look like this <img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/hnF53.png" data-original="https://i.stack.imgur.com/hnF53.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

so when we click dropdown it should push to the left side and show the dropdown menu list

this is code i have tried

<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container <div class="navbar-header"> <div class="container-fluid"> <div class="row"> <div class="col-xs-2 col-md-2" style="height:30px;margin-top:5px;"> <button type="button" class="navbar-toggle toggle-menu menu-left push-body" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="col-xs-8 col-md-8" style="height:30px;margin-top:5px;"> <input type="text" placeholder="email" class="form-control"> </div> <div class="col-xs-2 col-md-2" style="height:30px;margin-top:5px;"> <button type="submit" class="btn btn-success">submit</button> </div> </div> <div class="collapse navbar-collapse cbp-spmenu cbp-spmenu-vertical cbp-spmenu-left" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav"> <li class="active"><a href="#">Link</a></li> <li><a href="#">Link</a></li> <li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Dropdown <span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li><a href="#">Action</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> <li><a href="#">Another action</a></li> <li><a href="#">Something else here</a></li> </ul> </li> </ul> </div> </div> </div> </div> </nav> <script src="js/jPushMenu.js"></script> <script type="text/javascript"> //<![CDATA[ $(document).ready(function(){ $('.toggle-menu').jPushMenu({closeOnClickLink: false}); $('.dropdown-toggle').dropdown(); }); //]]> </script>

but i m not able to push to left side.

Answer1:

Is this something you looking for

<a href="http://jsfiddle.net/w6qc954t/" rel="nofollow">http://jsfiddle.net/w6qc954t/</a>

your template <a href="http://jsfiddle.net/w6qc954t/2/" rel="nofollow">http://jsfiddle.net/w6qc954t/2/</a>

its using jPushMenu.js by takien at github other than follwing part is include in that js

$(window).resize(function() { $('.cbp-spmenu').v2p({ height:'100vh' }); }); $(window).resize(); // trigger event so it shows on load $(document).ready(function(){ $('.toggle-menu').jPushMenu({closeOnClickLink: false}); $('.dropdown-toggle').dropdown(); });

Answer2:

This has been answered here already, use an "off canvas" layout provided for in Bootstrap code: <a href="https://stackoverflow.com/questions/20863288/bootstrap-3-slide-in-menu-navbar-on-mobile" rel="nofollow">Bootstrap 3 Slide in Menu / Navbar on Mobile</a>.

Recommend

  • Bootstrap grid won't work using xs columns
  • Fluid sticky footer using CSS
  • Where to get free math libraries for C/C++
  • bootstrap grid not working as expected [duplicate]
  • Jquery Show & ScrollTop (or ScrollTo)
  • CSS: How to fix overlapping divs
  • Change navbar in bootstrap if user login
  • Android Chronometer starts and stops but carries on counting when stopped
  • Floated image with variable width and heading with background image
  • UIAlertController button function not working
  • saving file generated by TCPDF
  • How to view images from protected folder with php?
  • D3 get axis values on zoom event
  • Adjust width of select element according to selected option's width
  • how to display data from 1st point on words on y axis for line chart in d3.js
  • onBackPressed() not being executed
  • Webgrid not refreshing after delete MVC
  • Textfile Structure (tables)
  • Custom validator control occupying space even though display set to dynamic
  • How do I alternate colors in Flat List (React Native)
  • Listbox within Listbox and scrolling trouble in Windows Phone 7 Silverlight
  • OpenGL 3.3 on Mac OSX El Capitan with LWJGL
  • Android fill_parent issue
  • Change multiple background-images with jQuery
  • How to set/get protobuf's extension field in Go?
  • Why doesn't :active or :focus work on text links in webkit? (safari & chrome)
  • vba code to select only visible cells in specific column except heading
  • Change an a tag attribute in JavaScript based on screen width
  • How to show dropdown in excel using jrxml (jasper api)?
  • jquery mobile loadPage not working
  • Properly structure and highlight a GtkPopoverMenu using PyGObject
  • align graphs with different xlab
  • Unanticipated behavior
  • using conditional logic : check if record exists; if it does, update it, if not, create it
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • How do I configure my settings file to work with unit tests?
  • IndexOutOfRangeException on multidimensional array despite using GetLength check
  • Can't mass-assign protected attributes when import data from csv file
  • Binding checkboxes to object values in AngularJs
  • Unable to use reactive element in my shiny app