Jack
Jack

Reputation: 3057

Bootstrap 3 simple dropdown not working

When trying to adjust to Bootstrap 3, I have encountered the following problem.

When I click on the button named F, I would like Home and Not Home to show up, but it does not at the moment.

This is the video I am learning from.

<div class= "navbar navbar-inverse navbar-static-top">
    <div class="container">
        <a class= "navbar-brand">Jackdh</a>
        <button class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse"> F 
        </button>
        <div class ="collapse navbar-collapse navHeaderCollapse">
            <ul class = "nav navbar-nav navbar-right">
                <li><a href="#">Home</a></li>
                <li><a href="#">Not Home</a></li>
            </ul>   
        </div>
    </div>
</div>

Upvotes: 2

Views: 8166

Answers (3)

deemyBoy
deemyBoy

Reputation: 65

@op (original poster)

Marcel's answer gave me a clue so I checked my script tag

<script src="bootstrap.min.js"></script>

I forgot to add the bootstrap javascript folder "js/"

With this script tag everything works fine.

<script src="js/bootstrap.min.js"></script>

@ Marcel - I couldn't vote up your answer due to lack of reputaion!

Upvotes: 2

rohit khare
rohit khare

Reputation: 1

You forgot to add navbar-header div after container, Try this one !

` Brand

        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navHeaderCollapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
    </div>`

Upvotes: 0

Marcel Gwerder
Marcel Gwerder

Reputation: 8520

I'm pretty sure that you simply forgot to add bootstrap.js and also jquery. With that included, everything works for me.

Upvotes: 8

Related Questions