Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8568541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:08:08+00:00 2026-06-11T18:08:08+00:00

i am working with mootools , and with foundation as my css framework. i

  • 0

i am working with mootools , and with foundation as my css “framework”.
i am using the navigation top-bar from foundation and its great. yet the responsive design was ruined.

since i am not working with jquery ….

http://jsfiddle.net/idanhen/3LXQb/ <– this is the foundation code.
http://foundation.zurb.com/docs/navigation.php <- navigation documentation

i cant understand the jquery script they did to convert it.
anyone know of a mootools responsive navigation bar ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T18:08:10+00:00Added an answer on June 11, 2026 at 6:08 pm

    Made it myself , thought i would share if someone will ever need it .

    original file is : “jquery.foundation.topbar.js”
    new file is : “mootools.foundation.topbar.js”

    1. just add foundation.css
    2. mootools-core-1.4.5 , mootools-more-1.4.0.1 ( i have both cause its a huge project , but i guess u can only use the core … )
    3. mootools.foundation.topbar.js

    and ofcourse run the following command :

    <script type="text/javascript">
    window.addEvent('domready', function() {
    window.foundationTopBar();
    });
    </script>

    “mootools.foundation.topbar.js” :

    `
    /**
    * mootools.foundation.topbar
    *
    * taken from foundation.topbar.js
    * http://foundation.zurb.com
    *
    * Written by Idan Hen : idandush@gmail.com
    */

    ;(function ($, window, undefined) {
      'use strict';
    
        /* just create settings object */
        var settings = {
            index : 0,
            breakPoint : 940, // Set to to 9999 to force it into responsive always
            initialized : false
          };
        var  methods = {        
            init : function (options) {
              return function () {            
                settings = Object.merge(settings, options); //settings = $.extend(settings, options);
                settings.window = window;
                settings.topbar = $$('nav.top-bar');
                settings.titlebar = settings.topbar.getChildren('ul')[0]; // getElement() just return #
    
    
                if (!settings.initialized) {
                  methods.assemble();
                  settings.initialized = true;
                }
    
                if (!settings.height) {
                  methods.largestUL();
                }
                $$('.top-bar .toggle-topbar').getParent().addEvent('click.fndtn:relay(.top-bar .toggle-topbar)', function (e) { //live switched to addEvent
                  e.preventDefault();
                  if (methods.breakpoint()) {
                    settings.topbar.toggleClass('expanded');
                    settings.topbar.setStyle('min-height', ''); //css
                  }
                });
    
                // Show the Dropdown Levels on Click            
                $$('.top-bar .has-dropdown>a').getParent().addEvent('click.fndtn:relay(.top-bar .has-dropdown>a)', function (e) {
                  e.preventDefault();
                  if (methods.breakpoint()) {
                    var anchor = $(this),
                        selectedLi = anchor.getParent('li'), // closest -> getParent
                        section = anchor.getParents('section')[0],// closest -> getParents
                        largestUl;
    
                    settings.index += 1;
                    selectedLi.addClass('moved');
                    section.setStyle('left', -(100 * settings.index) + '%');
                    section.getElements('>.name').setStyle('left', 100 * settings.index + '%');
    
                    //outerHeight
                    anchor.getSiblings('ul').setStyle('height', (settings.height + settings.titlebar.getSize().y));
                    settings.topbar.setStyle('min-height', settings.height + settings.titlebar.getSize().y * 2) //outerHeight
                  }
                });
    
                // Go up a level on Click
                $$('.top-bar .has-dropdown .back').getParent().addEvent('click.fndtn:relay(.top-bar .has-dropdown .back)', function (e) {
                  e.preventDefault();
    
                  var anchor = $(this),
                    movedLi = anchor.getParent('li.moved'),
                    section = anchor.getParents('section')[0],
                    previousLevelUl = movedLi.getParent();
    
                  settings.index -= 1;
                  section.setStyle('left', -(100 * settings.index) + '%'); //css
                  section.getElements('>.name').setStyle('left', 100 * settings.index + '%'); // find
    
                  if (settings.index === 0) {
                    settings.topbar.setStyle('min-height', 0); // changed topbar from $topbar
                  }
    
                  setTimeout(function () {
                    movedLi.removeClass('moved');
                  }, 300);
                });
              }.call(window.document.HTMLDocument);
            },
            breakpoint : function () {
              return settings.window.getSize().x < settings.breakPoint; //width()
            },
            assemble : function assemble() {
              var section = settings.topbar.getElements('section')[0];
    
              // Pull element out of the DOM for manipulation          
              section = section.dispose(); //detach
    
              //console.log('section.getElements.n>a : ', section.getElements('.has-dropdown>a'));
              section.getElements('.has-dropdown>a').each(function(e){
                e.each(function (e) {                
                    //console.log('section' , section);
                    var link = $(e),
                        dropdown = link.getSiblings('.dropdown'), //siblings                    
                        //<li class="title back js-generated"><h5><a href="#"></a></h5></li>
                        a = new Element('a', {
                            href: '#'
                        }),
                        h5 = new Element('h5', {}),
                        titleLi = new Element('li', {
                            'class': 'title back js-generated'
                        });//section.getChildren('ul li');// back js-generated');
    
    //                    console.log('dropdown: ', dropdown);
                        h5.grab(a);
                        titleLi.grab(h5);
                        // Copy link to subnav
                        titleLi.getElements('h5>a').set('html', (link.get('html') ) ); // find -> getElements
                        dropdown.grab(titleLi, 'top');
                    });
                });
              // Put element back in the DOM
                settings.topbar[0].grab(section[0]); // section.appendTo(settings.topbar); 
            },
            largestUL : function () {
              var uls = settings.topbar[0].getElements('section ul ul'), // find -> getElements
                  largest = uls.getFirst(),
                  total = 0;
              uls.each(function(ul){
                if (ul.getChildren('li').length > largest.getChildren('li').length) { //length -> getSize().x
                  largest = ul;
                }
              });
    
              largest.getChildren('li').each(function (li) { total += li.getComputedSize().height; }); //outerHeight(true); -> getSize().y          
              settings.height = total;
            }
      };
    
      /**
       * this function is added to the window -> need to add it myself
       * apply is call ...
       */
      window.foundationTopBar = function (method) 
      {
        if (methods[method]) {
          return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
        } else if (typeof method === 'object' || !method) {
          return  methods.init.apply(this, arguments);
        } else {
          $.error('Method ' +  method + ' does not exist on jQuery.foundationTopBar');
        }
      };
    }($, this));
    

    `

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the mootools wall plugin, Its working well in my application, however if
I have a jQuery code, but need it working by using Mootools: if (
Working on game where plates will be falling from top to bottom. Some plates
I am developing one site using joomla 1.5 and mootools 1.1 for js framework,
Although I am using the Zend framework, MooTools JS library and my questions revolves
I've been working on some simple AJAX functions recently, using MooTools. My problem lies
I'm working on an ASP.net 3.5 website with MooTools as the AJAX framework. I
I am using the code MooTools (1.11) and jQuery (1.2.6). It's working fine when
How to check element existence using its alias attributes with Mootools Tried as follows.
Using MooTools Request.HTML, I have my Request call working perfectly, updating my page element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.