jquery - Expand multiple dropdown menus using a href link -


in header nav, have 3 dropdown toggles hoping able expand allow user click on href link?

here dropdown nav code:

<li class="dropdown"> <a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">     <i class="fa fa-question-circle fa-fw"></i> <i class="fa fa-caret-down"></i> </a>  <ul class="dropdown-menu dropdown-alerts">     <div class="" style="overflow-y: scroll;height:385px;width:350px; padding-left:0.5cm">         <b>support</b> tickets         <li class="divider"></li>         <li>             <a class="text-center" href="messages.php?show=support">                 <strong>see open tickets</strong><i class="fa fa-angle-right"></i>             </a>         </li>      </div> </ul> 

is there way can open when user clicks link located somewhere else on page, such as:

<a href="#dropdown-toggle">open dropdown</a>

or similar?

your code looks little strange, i'll give general idea.

html

<a href="#" id="open">open dropdowns</a> 

js

$('#open').onclick(function(){     $('.dropdown-toggle').click(); }); 

what javascript that, when click on element id "open", simulate click on all elements class "dropdown-toggle". easy method, work you.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -