wp-bootstrap-navwalker icon indicating copy to clipboard operation
wp-bootstrap-navwalker copied to clipboard

Dropdown not working

Open ghost opened this issue 12 years ago • 5 comments

Hi,

I can able to view the dropdown icon. But on hover or click the sub menu is not opening. Could you please guide me how to do that.

ghost avatar Jan 03 '14 18:01 ghost

With Bootstrap 3, dropdowns olly work on click. I the menu is not working on click the cause is most likely the the required dropdown.js file is not loading correctly or is not included in your bootstrap.js build.

SideQuestDIY avatar Jan 07 '14 20:01 SideQuestDIY

Hi Twittem,

Even added dropdown.js and bootstrap.js am not able to dropdown the menu.

here is the code,

Script

<link rel='stylesheet' id='buffercode-style-css'  href='http://localhost/buffercode/wp-content/themes/buffercode/style.css?ver=3.8.1' type='text/css' media='all' />
<link rel='stylesheet' id='buffercode-style-boot-css'  href='http://localhost/buffercode/wp-content/themes/buffercode/css/bootstrap.css?ver=3.8.1' type='text/css' media='all' />
<link rel='stylesheet' id='buffercode-dropdown-css'  href='http://localhost/buffercode/wp-content/themes/buffercode/css/dropdown.css?ver=3.8.1' type='text/css' media='all' />
<script type='text/javascript' src='http://localhost/buffercode/wp-content/themes/buffercode/js/bootstrap.js?ver=3.8.1'></script>
<script type='text/javascript' src='http://localhost/buffercode/wp-content/themes/buffercode/js/dropdown.js?ver=3.8.1'></script>
<script type='text/javascript' src='http://localhost/buffercode/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>
<script type='text/javascript' src='http://localhost/buffercode/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://localhost/buffercode/xmlrpc.php?rsd" />
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://localhost/buffercode/wp-includes/wlwmanifest.xml" />

HTML Code

<nav class="navbar navbar-default " role="navigation">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="container">
          <div class="collapse navbar-collapse navbar-ex1-collapse"><ul id="menu-menu" class="nav navbar-nav"><li id="menu-item-152" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-152"><a title="Home" href="http://localhost/buffercode/">Home</a></li>
<li id="menu-item-89" class="menu-item menu-item-type-taxonomy menu-item-object-category current-category-ancestor current-category-parent menu-item-has-children menu-item-89 dropdown"><a title="cat 1" href="#" data-toggle="dropdown" class="dropdown-toggle">cat 1 <span class="caret"></span></a>
<ul role="menu" class=" dropdown-menu">
    <li id="menu-item-92" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-92"><a title="cat 3" href="http://localhost/buffercode/category/cat3/">cat 3</a></li>
</ul>
</li>
<li id="menu-item-90" class="menu-item menu-item-type-taxonomy menu-item-object-category current-menu-item menu-item-90 active"><a title="cat 1 1" href="http://localhost/buffercode/category/cat1/cat11/">cat 1 1</a></li>
<li id="menu-item-91" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-91 dropdown"><a title="cat 2" href="#" data-toggle="dropdown" class="dropdown-toggle">cat 2 <span class="caret"></span></a>
<ul role="menu" class=" dropdown-menu">
    <li id="menu-item-168" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-168 dropdown"><a title="About The Tests" href="http://localhost/buffercode/about/">About The Tests</a>
    <ul role="menu" class=" dropdown-menu">
        <li id="menu-item-170" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-170"><a title="Lorem Ipsum" href="http://localhost/buffercode/lorem-ipsum/">Lorem Ipsum</a></li>
    </ul>
</li>
</ul>
</li>
<li id="menu-item-173" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-173 dropdown"><a title="Level 3" href="#" data-toggle="dropdown" class="dropdown-toggle">Level 3 <span class="caret"></span></a>
<ul role="menu" class=" dropdown-menu">
    <li id="menu-item-175" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-175 dropdown"><a title="Level 2" href="http://localhost/buffercode/level-2/">Level 2</a>
    <ul role="menu" class=" dropdown-menu">
        <li id="menu-item-177" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-177"><a title="Level 1" href="http://localhost/buffercode/level-1/">Level 1</a></li>
    </ul>
</li>
</ul>
</li>
<li id="menu-item-702" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-702"><a title="Front Page" href="http://localhost/buffercode/front-page/">Front Page</a></li>
<li id="menu-item-704" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-704"><a title="Blog" href="http://localhost/buffercode/blog/">Blog</a></li>
<li id="menu-item-734" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-734"><a title="Page A" href="http://localhost/buffercode/page-a/">Page A</a></li>
</ul></div>    </div>
</nav>

Kindly suggest me.

ghost avatar Feb 17 '14 16:02 ghost

Everything in the HTML markup looks ok, usually an issue like this caused either when jquery is loaded twice or the bootstrap .js is not loaded correctly. If you provide the lines of code where your javascript it being loaded I can probably help you out.

I did notice you are loading bootstrap.css & dropdown.css as well as a bootstrap.js & dropdown.js if there are overlapping function names or conflicting css it would also cause the issue.

SideQuestDIY avatar Feb 18 '14 17:02 SideQuestDIY

Hi twittem,

Yes you are right. Actually I didn't load the bootstrap.js properly. Now its working fine. thanks for your reply.

ghost avatar Feb 18 '14 17:02 ghost

No problem, its usually just the pesky variable that says this script uses jquery when loading it. Glad everything is working for you. :)

SideQuestDIY avatar Feb 18 '14 17:02 SideQuestDIY