jquery工具提示在我的网站上没有响应,但在JSFIDDLE中工作正常



有人可以帮我吗?

这是我的小提琴..工作正常。

http://jsfiddle.net/supplement/j77eB/

现在,当我像这样将我的代码发布到我的网站上时......

<head>  
    <script src="http://code.jquery.com/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/jquery-ui.js"></script>
<link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/themes/black-tie/jquery-ui.css" rel="stylesheet" type="text/css">
    <style type="text/css">
      label {
          display: inline-block;
          width: 5em;
      }
      .red {
          color: red;
      }
    }
    </style></head>
<script>$(function () {
    $(document).tooltip({
        content: function () {
            return $(this).prop('title');
        },
        show: null, 
        close: function (event, ui) {
            ui.tooltip.hover(
            function () {
                $(this).stop(true).fadeTo(400, 1);
            },
            function () {
                $(this).fadeOut("400", function () {
                    $(this).remove();
                })
            });
        }
    });
});</script>
<p><a href="#" title="<span class='red'>This is a <a href='#'>link</a></span>">Tooltips</a> can be attached to any element. 
    When you hover the element with your mouse, the title attribute is displayed in a little box next to the element, 
    just like a native.</p>

它不行...

是我的链接有问题吗?

<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/themes/black-tie/jquery-ui.css"></script>

您正在将 CSS 文件引用为 JS。

大概你的意思是有:

<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.0/jquery-ui.js"></script>

最新更新