this is my current javascript includes
<%= javascript_include_tag 'jquery','application' %>
its works fine but the moment i add the bootstrap-dropdown plugin.
<%= javascript_include_tag 'jquery','bootstrap-transition','bootstrap-dropdown','application'%>
i get an error (firebug console) thats from the bootstrap-dropdown file.
--$("html").on is not a function
[Break On This Error]
$('html').on('click.dropdown.data-api', clearMenus)--
not too sure what I'm doing wrong here or what i did not catch/get. oh btw the old bootstrap-dropdown worked for me.
Why is my drop down menu not working in bootstrap? Solution : The dropdown should be toggled via data attributes or using javascript. In the above program, we have forgotten to add a data attribute so the dropdown is not working. So add data-bs-toggle="dropdown" to toggle the dropdown.
Basic Dropdown To open the dropdown menu, use a button or a link with a class of . dropdown-toggle and the data-toggle="dropdown" attribute. Add the . dropdown-menu class to a <div> element to actually build the dropdown menu.
All Bootstrap's JavaScript files depend on util. js and it has to be included alongside the other JavaScript files. If you're using the compiled (or minified) bootstrap. js , there is no need to include this—it's already there.
This behavior can be changed by using the autoClose property. By default, autoClose is set to the default value true and behaves like expected. By choosing false, the dropdown menu can only be toggled by clicking on the dropdown button.
You need to upgrade to jQuery 1.7.1.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With