简体   繁体   English

使用工具提示时Div消失

[英]Div vanishes when using tooltipster

I want to use the jquery plugin tooltipster for my website. 我想为我的网站使用jquery插件工具提示。 But whenever i want to add a tooltip do a div, the div itself vanishes. 但是,每当我想添加工具提示时,进行div时,div本身就消失了。 The funny part is that when i hover over the place the div was meant to be i still get to see the tooltip. 有趣的是,当我将鼠标悬停在div上时,我仍然会看到工具提示。

HTML: HTML:

<!DOCTYPE html>
<html lang="en">

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Bootstrap 101 Template</title>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.0.min.js"></script>
        <script type="text/javascript" src="js/jquery.tooltipster.min.js"></script>
        <link rel="stylesheet" type="text/css" href="css/tooltipster.css" />
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="MyStyle.css"></link>
    </head>

    <body>
        <div style="background-color:green; width:500px; height:500px;" class="tooltip" title="This is my div's tooltip message!"></div>
        <script>
            $(document).ready(function() {
                $('.tooltip').tooltipster();
            });
        </script>
    </body>

</html>

There is no other CSS than the inline one for the div in this test example. 在此测试示例中,除了div的内联CSS外没有其他CSS。 Please help me out with this mysterious problem. 请帮助我解决这个神秘的问题。

<div style="background-color:green; width:500px; height:500px;" class="tooltip" title="This is my div's tooltip message!">You Must add content here</div>

Try this... 尝试这个...

<html>
    <html lang="en">
    <head>
      <title>Bootstrap 101 Template</title>
      <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
      <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    </head>
    <body>

    <div class="container"  style="background-color:green; width:500px; height:500px;">
<h1>Here is the example</h1>
      <a href="#" style="color:#ff0000;" data-toggle="tooltip" title="This is my div's tooltip message!">Hover Over Me</a>
    </div>

    <script>
    $(document).ready(function(){
        $('[data-toggle="tooltip"]').tooltip();   
    });
    </script>

    </body>
    </html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM