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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:41:55+00:00 2026-06-15T00:41:55+00:00

I’m working with Twitter Bootstrap for the first time. Everything seems to be working

  • 0

I’m working with Twitter Bootstrap for the first time. Everything seems to be working correctly except my top navigation needs tweaked.

We have a menu button which opens the main nav dropdown. Then we have a search button which opens a search form dropdown.

<div class="navbar navbar-fixed-top">
  <div class="navbar-inner">
    <div class="container">
      <a class="btn btn-navbar menubutton" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="menu">Menu</span>
      </a>
      <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-search"><img src="images/search_03.png">Search</a>

      <div class="nav-collapse collapse">
        <ul class="nav">
          <li><a href="#">About Us</a></li>
          <li><a href="#">Research &amp; Innovation</a></li>
          <li><a href="#">Our Products</a></li>
          <li><a href="#">Responsibility</a></li>
          <li class="subnav"><a href="#" >Careers</a></li>
          <li class="subnav"><a href="#" >Newsroom</a></li>
          <li class="subnav"><a href="#" >Contact Us</a></li>
          <li class="navfoot">This is a mobile version of our website<br/>
          <a href="#">View full site</a></li>
        </ul>
      </div><!--/.nav-collapse -->
      <div class="nav-search collapse">
            <div class="search_box">
            <form action="" method="post">
                <input type="text" value="Enter Search"><a href="#">Search</a>
            </form>
            </div><!-- end search_box -->
      </div><!--/.nav-search -->
    </div>
  </div>
</div>​

I’ve created a jsfiddle here: http://jsfiddle.net/vsF6m/3/

The client wants only a single dropdown open at a time. Right now, the functionality is each button will toggle itself, but not close the other open dropdown.

There has to be something I’m missing. Do I need to rebuild how that nav bar is assembled?

Thanks!

  • 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-15T00:41:57+00:00Added an answer on June 15, 2026 at 12:41 am

    Here’s something more along the lines of how Bootstrap implements accordion functionality with the Collapse plugin. My first inclination was to recommend just using the accordion markup for your purposes, but unfortunately some of the markup used to set up the accordion functionality (namely, the class .accordion-group), has visual styles associated with it, so it’s probably just easier to use a watered down version of the code targeted to what you require.

    Here’s the relevant snippet:

    $('.navbar').on('show', function () {
      var actives = $(this).find('.collapse.in')
        , hasData
    
      if (actives && actives.length) {
        hasData = actives.data('collapse')
        if (hasData && hasData.transitioning) return
        actives.collapse('hide')
        hasData || actives.data('collapse', null)
      }
    })
    

    This will close any other open collapse elements found within the delegated parent, which in this case is .navbar. In practice I recommend using an ID rather than a class to select the delegated parent.

    JSFiddle

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.