Search code examples
mootools

Responsive NavBar Bootstrap with Mootools


I am trying to make a responsive navbar menu, just like the navbar of bootstrap but I can not use jquery, I am using Mootools. Have anyone done this behavior before? Thanks.

Code:


Solution

  • You should definitely provide more info, also Dimitar Christoff is right saying that responsiveness is powered by media queries.

    But I can imagine your problem is actually to toggle the collapsed menu when clicking over the menu button, if this is the case I used to use this code, with mootools and bootstrap 3.

    /* bootstrap */
    window.addEvent('load', function() {
      $$('button[data-toggle=collapse]').each(function(btn) {
        var target = $(btn.get('data-target'));
        btn.addEvent('click', function() {
          target.toggle();
        })
      });
    })