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 8839611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:16:29+00:00 2026-06-14T10:16:29+00:00

I am beginner in JS. I found wonderful example of responsive menu , and

  • 0

I am beginner in JS.
I found wonderful example of responsive menu, and put code inside functions.php. Menu must works like here http://filamentgroup.com/examples/rwd-nav-patterns/ but i have the bug – dropdown menu shift to the right in my site when I use tablet mode.

I tried to include this menu in my site, based on Bootstrap http://b.pusku.com

  • 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-14T10:16:30+00:00Added an answer on June 14, 2026 at 10:16 am

    UPDATE:

    Part of the problem with the fiddle was that the space allotted for the logo image was too wide, so I added the following to correct that:

    #logo > img {
        width: 25px;
    }
    

    To get the dropdown to float left at all times, add:

    .nav-menu .nav-primary {
        float: left;
        clear: none;
    }
    

    to the @media screen and (min-width: 910px) rule…

    @media screen and (min-width: 910px) {
        .nav-primary {
            float: right;
            clear: none;
        }   
        .nav-menu .nav-primary {
            float: left;
            clear: none;
        }
    }
    

    Once the navigation links collapse to a dropdown, they’ll float left. The links will have an offset of 25px on the left because of the following rule in bootstrap.css (on line 728):

    ul, ol {
        padding: 0;
        margin: 0 0 10px 25px; /*specifically this rule*/
    }
    

    You can override that, if you like, by adding margin-left: 0; to the .nav-primary ul rule:

    .nav-primary ul {
       border: 1px solid #e6e6e6;
        margin-left: 0; /* add this to override the bootstrap.css rule*/
    }
    

    Finally, as the screen width narrows, the dropdown’s width seems to stretch the entire width. If this is not a desired effect, add display: inline-block; to the .nav-primary rule:

    .nav-primary {
        clear: left;
        margin: 0 0 2em;
        display: inline-block;
    }
    

    I’ve also re-written the javascript that makes the “responsive” navigation collapse to a dropdown using more (appropriately named) variables so you may better understand why the script does what it does:

    $(document).ready(function () {
        'use strict';
        $('.nav-primary')
        // test the menu to see if all items fit horizontally
            .bind('testfit', function () {
                var nav = $(this),
                    navPrimaryTop = nav.offset().top, // top of div.nav-primary
                    navSkipNavTop = nav.prev().offset().top, // top of p containing a#main
                    topOfFirstLink = nav.find('li:first-child').offset().top, //top of "What We Done"
                    topOfLastLink = nav.find('li:last-child').offset().top, //top of "Contact Us"
                    navBelowSkipNav = navPrimaryTop > navSkipNavTop, //boolean indicating whether div.nav-primary is below the p containing a#main
                    lastLinkBelowFirstLink = topOfLastLink > topOfFirstLink, //boolean indicating whether "Contact Us" is below "What We Done"
                    displayAsMenu = navBelowSkipNav || lastLinkBelowFirstLink; // boolean indicating whether to collapse to a dropdown menu
                $('body').removeClass('nav-menu');
                if (displayAsMenu) {
                    $('body').addClass('nav-menu');
                }
            })
            // toggle the menu items' visiblity
            .find('h3').bind('click focus', function () {
                $(this).parent().toggleClass('expanded');
            });
        // ...and update the nav on window events
        $(window).bind('load resize orientationchange', function () {
            $('.nav-primary').trigger('testfit');
        });
    });
    

    Here’s an updated fiddle demonstrating the basics: http://jsfiddle.net/DD7MC/1/

    I did not override either the margin-left or the display in the updated fiddle.

    ORIGINAL:

    I think it’s a CSS conflict between rwd-nav.css and bootstrap.css. Try changing the class definition for .nav-menu .nav-primary h3 in rwd-nav.css to:

    .nav-menu .nav-primary h3 {
       position: absolute;
       top: -10px; /* <-- change this line */
       left: auto;
       right: 0;
       display: block;
       width: 4em;
       height: 3.75em;  /* <-- change this line */
       background: #ccc url(img/icons.png) no-repeat -205px 45%;
       text-indent: -999em;
       cursor: pointer;
       font-size: inherit; /* <-- add this line */
    }
    

    Also, your hosting provider is returning a 404 for url(img/icons.png). You may want to make sure that file exists.

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

Sidebar

Related Questions

I am a beginner in C. While reading git's source code, I found this
Beginner help needed :) I am doign an example form a php book which
i am a beginner in iphone programming ,i found the following code on a
i am a ruby beginner and i found a problem, i would like to
Python beginner here. I've looked around and found similar questions but can't quite cobble
I am a PHP beginner. When going through a PHP script I found: if(preg_match('/(?i)ID=(\d+)/',$input))
beginner PHP programmer here trying to use the mailchimp API... I keep getting this
I am a C# beginner. I found there are 2 way to write codes
I've been getting into compiler creation. I've found some terrific beginner stuff and advanced
Beginner iOS dev here. I have a problem in my array. Im making an

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.