2014-02-27 58 views
0

有人可以请帮我..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> 

它不工作...

是它的东西与我联系?

+0

什么是您的控制台日志说? – Rhys

+0

未捕获的SyntaxError:意外的令牌。 jquery-ui.css:8 Uncaught TypeError:Object [object Object] has no method'tooltip'tooltip.php:19 –

+0

这些是我在控制台日志中唯一的两个错误。 –

回答

0
<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> 
+0

哦,大屎..我知道这将是一个愚蠢的错误。 –

相关问题