javascript - bootstrap 3 不在 jQuery select2 上显示工具提示

标签 javascript jquery html css twitter-bootstrap-3

我使用 select2 插件设计我的选择框。现在,我需要在选择框顶部显示工具提示。

HTML:

<select class="selectD input-sm" name="newsoptions_amount" data-toggle="tooltip" data-placement="bottom" title="Gallery Cover">
    <option>1</option>
    <option>2</option>
    <option>3</option>
</select>
    <br><br><br>

    <a class="width24 thumbcheck" data-toggle="tooltip" data-placement="bottom" title="Gallery Cover" data-id="">test tooltip</a> 

JS:

$(document).ready(function () {
    $(".selectD").select2({
        allowClear: true
    });
});
$("[data-toggle='tooltip']").tooltip();

/*     
 * Add collapse and remove events to boxes
 */
$("[data-widget='collapse']").click(function () {
    //Find the box parent        
    var box = $(this).parents(".box").first();
    //Find the body and the footer
    var bf = box.find(".box-body, .box-footer");
    if (!box.hasClass("collapsed-box")) {
        box.addClass("collapsed-box");
        bf.slideUp();
    } else {
        box.removeClass("collapsed-box");
        bf.slideDown();
    }
});

我在选择框中添加 data-toggle="tooltip"data-placement="bottom"title="Gallery Cover" 但不显示工具提示!

如何在选择框顶部显示工具提示?!

演示 here

最佳答案

只需替换:

$("[data-toggle='tooltip']").tooltip();

$(".selectD").tooltip();

demo

关于javascript - bootstrap 3 不在 jQuery select2 上显示工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26160447/

相关文章:

c# - 如何从 Kendo TreeView 数据源获取特定节点值?

javascript - 为什么context和rootjQuery可以执行 '||'操作?并且返回的结果不是boolean类型?

html - 如何设置多选的宽度?

html - vim omni-complete 可以删除我之前选择的单词吗?

javascript - 从另一个div点击设置div的全高和宽度

javascript - 如何让我的文本输入从笔记本电脑图像屏幕的顶部开始

javascript - IE 11 - 日期不工作

javascript - 在 IE7 中更改类名时背景位置不起作用

javascript - 根据滚动方向切换移动导航

javascript - 如何使用feathers.js避免服务在钩子(Hook)中多次运行?