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

  • SEARCH
  • Home
  • 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 775799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:20:57+00:00 2026-05-14T19:20:57+00:00

I was browsing the web and found this site . I noticed how the

  • 0

I was browsing the web and found this site. I noticed how the nav bar drop-down works, and I want to implement something similar on my website.

Afer going into the source code of the page, I found that those drop-down areas are contained in divs with class fOut.

It turns out that this is being done with MooTools. Here is the script itself (referenced in the original page after the Mootools script itself):

window.addEvent('domready', function() {


    $("primaryNav").getChildren("li").addEvents({
        "mouseenter": function(){
            $(this).addClass("hover").getChildren("a").addClass("hover");
        },
        "mouseleave": function(){
            $(this).removeClass("hover").getChildren("a").removeClass("hover");
        }
    });

    $$(".fOut").each(function(el,i){
        var ifr = $(document.createElement("iframe"));
        ifr.className = "ieBgIframe";
        ifr.frameBorder = "0";
        ifr.src="about:blank";

        ifr.injectInside(el);
        var p = el.getParent();
        p.addClass("hover");
        var h = el.getSize().size.y;
        p.removeClass("hover");
        ifr.height=h;
    });

    $$(".olderVersionsToggle").addEvents({
        "click": function(e){

            var event = new Event(e);
            event.stop();

            var p = $(this).getParent().getNext();

            if(p.hasClass("open")){
                p.removeClass("open");
                $(this).setText("Show previous versions...");
            }
            else{
                p.addClass("open");
                $(this).setText("Hide previous versions...");
            }


            return false;

        }
    });


});

My Question(s)

I have two questions about this code.

  1. How does it work? I don’t quite understand what it’s doing, with the iframes and all.
  2. How can this be implemented in jQuery?
  • 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-05-14T19:20:57+00:00Added an answer on May 14, 2026 at 7:20 pm

    It works just like any other fly over menu, the submenu is statically positioned and they add the hover state (class) when you mouse over a menu item. It looks (from the DOM) like they are using the iframe to hack some IE issues. Open up a console session and watch the elements to see what I mean, the iframes do not change over time, they just sit there empty.

    As for implementing it in jQuery I would start with your dom layout (make sure everything lines up in the same area and fill in your sub-menus with well designed content). Then just bind up the mouseenter and mouseleave events like:

    $("primaryNav li").mouseenter(function() {$(this).addClass("hover");$("a", this).addClass("hover");});
    $("primaryNav li").mouseleave(function() {$(this).removeClass("hover"); $("a", this).removeClass("hover");});
    

    They are using iframe to set a consistent height across the elements (it seems), you could do this by simply setting the div height to be either a static amount or after rendering each sub-menu just find the tallest one (using innerHeight or outerHeight depending on your need) and set the rest to match it in height.

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

Sidebar

Related Questions

I recently was browsing a local web design firm's portfolio and found all their
I'm browsing web searching for english language grammar, but i found only few simple
I found out randomly that when browsing an SVN repository from a web browser
I've been browsing around the web and i've found a few things that suggest
I came across this method browsing the web searching for recursive methods. Believe me,
When browsing the source of a project on web I've found some return statement
I haven't seen this problem when browsing the web, so here it is: I
I've been browsing through the web but haven't been able to find any concrete
I have been browsing around on the internet and researching effective sitemap web pages.
Browsing the Internet, I found the new Ample SDK JavaScript framework. From their about

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.