Bootstrap Multiselect不起作用 [英] Bootstrap Multiselect not working

查看:151
本文介绍了Bootstrap Multiselect不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用多选引导程序,我使用了以下代码,这些代码也可以在他们的网站上找到(( http: //davidstutz.github.io/bootstrap-multiselect/),它显示了多选按钮,而且正如我已经将奶酪和意大利辣香肠"的选定选项放入一样,它也已经选择了它们,但是无论何时我单击它,它没有打开要选择的列表!

I'm trying to use multiselect Bootstrap, I used the following code which is also available in their website too at (http://davidstutz.github.io/bootstrap-multiselect/), it shows the button for multi-select and as I already put the selected option for "cheese and pepperoni", it has already selected them too, but whenever I click on it, it does not open the list to choose!

<!-- Include the plugin's CSS and JS: -->
<script src="http://code.jquery.com/jquery.js"></script>    
<script type="text/javascript" src="<?php echo base_url('bootstrap/js/bootstrap-multiselect.js'); ?>"></script>

<link href="<?php echo base_url('bootstrap/css/bootstrap-multiselect.css'); ?>" rel="stylesheet" type="text/css">    
<link href="<?php echo base_url('bootstrap/css/bootstrap.min.css'); ?>" rel="stylesheet" type="text/css">                  
<script type="text/javascript" src="<?php echo base_url('bootstrap/js/bootstrap.min.js'); ?>"></script>    

<!-- Build your select: -->
<select class="multiselect" multiple="multiple" name="my-select[]" id="my-select">
    <option value="cheese" selected>Cheese</option>
    <option value="tomatoes">Tomatoes</option>
    <option value="mozarella">Mozzarella</option>
    <option value="mushrooms">Mushrooms</option>
    <option value="pepperoni" selected>Pepperoni</option>
    <option value="onions">Onions</option>
</select>

<script type="text/javascript">
    $(document).ready(function() {     
            $('.multiselect').multiselect();      
    });
</script>

我错过了什么吗?

如果您认为我的问题不清楚,请告诉我您需要进一步澄清的部分.

Also if you think my question is not clear please let me know which part you need more clarification.

非常感谢.

推荐答案

尝试添加bootstrap.js文件( http://getbootstrap.com/javascript/).我想念那些,而且似乎是必需的.

Try adding the bootstrap.js files (http://getbootstrap.com/javascript/). I missed those and it seems like these are required.

这篇关于Bootstrap Multiselect不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆