Search code examples
jquerytwitter-bootstrapbootstrap-select

Bootstrap-select does not toggle "open" class


Check it out please -> FIDDLE

I downloaded the source from http://silviomoreto.github.io/bootstrap-select/, I really have no idea why it's not toggling "open" class of ".dropdown-toggle" I can fix it by adding some messy scripts, but I prefer the plugin to work right.

the HTML:

<div class="number customdp">
<select class="simple-dropdown" name="number">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
    <option>5</option>
</select>

does anybody have a solution ?


Solution

  • It has a dependency on twitter bootstrap. Include their CSS and JavaScript files like so:

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    
    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    

    See this updated fiddle with the CSS and JS included, and it seems to work just fine.