如何在twitter bootstrap的模式对话框中使用工具提示插件? [英] How do I use tooltip plugin in twitter bootstrap's modal dialog?

查看:124
本文介绍了如何在twitter bootstrap的模式对话框中使用工具提示插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有。
我正在使用bootstrap v2.1.1(目前的最新版本)。
我需要在我的模式对话框中使用工具提示。

 <!DOCTYPE html> 
< html lang =zh-CN>
< head>
< title> Bootstrap v2.1.1< / title>
< meta http-equiv =Content-Typecontent =text / html; charset = UTF-8/>
< link type =text / css =stylesheethref =css / bootstrap.min.css/>
< link type =text / css =stylesheethref =css / bootstrap-responsive.min.css/>

< script type =text / javascriptsrc =js / jquery-1.8.2.min.js>< / script>
< script type =text / javascriptsrc =js / bootstrap.min.js>< / script>
< script type =text / javascript>
$(document).ready(function(){
$(a [rel ='tooltip'])。tooltip({'placement':'right','z-index': '3000'});
});
< / script>
< / head>

< body>
< div class =modal modal-open>
< form class =modal-form form-horizo​​ntal>
< div class =modal-header>
< h3>登入< / h3>
< / div>
< div class =modal-body>
< a href =# =tooltiptitle =这是一个链接。>链接< / a> <! - 检查出来 - >
< / div>
< div class =modal-footer>
< button type =submitclass =btn btn-primary>登入< / button>
< button type =resetclass =btn>重设< / button>
< / div>
< / form>
< / div>
< / body>



但代码无效。
引导程序的最新版本显示模态的z-index为1050.



和bootstrap.min.css中的内容

  .modal-open .modal .tooltip {z-index:2080;} 

我认为这不可能是z-index问题。

任何人都可以提供帮助吗? thx很多。

解决方案

请尝试将此添加到您的CSS文件中:

  .tooltip {
z-index:2000!important;
}


all. i am using bootstrap v2.1.1 (the newest version currently). i need a tooltip in my modal dialog.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>Bootstrap v2.1.1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link type="text/css" rel="stylesheet" href="css/bootstrap.min.css" />
    <link type="text/css" rel="stylesheet" href="css/bootstrap-responsive.min.css"/>

    <script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("a[rel='tooltip']").tooltip({'placement': 'right', 'z-index': '3000'});
        });
    </script>
</head>

<body>      
    <div class="modal modal-open">
        <form class="modal-form form-horizontal">
            <div class="modal-header">
                <h3>Login</h3>
            </div>
            <div class="modal-body">
                <a href="#" rel="tooltip" title="This is a link.">A link</a>        <!-- check it out -->
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-primary">Login</button>
                <button type="reset" class="btn">Reset</button>
            </div>
        </form>
    </div>
</body>

but the code does NOT work. The lastest version of bootstrap shows the modal has a z-index of 1050.

and in bootstrap.min.css

.modal-open .modal .tooltip{z-index:2080;}

This is could not be z-index issue, i think.

anyone can help ? thx a lot.

解决方案

Try add this into your CSS file:

.tooltip {
    z-index: 2000 !important;
}

这篇关于如何在twitter bootstrap的模式对话框中使用工具提示插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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