2014-07-10 26 views
2

我是jQuery的新手,並且已經嘗試了ToolTip WidgetjQuery工具提示顯示額外的div

當顯示工具提示時,在顯示的工具提示內容的文本內容下還會顯示一個額外的div。

這是不受歡迎的,我不知道如何擺脫它。

請參閱: jsFiddle link for Trying jQuery ToolTip瞭解我遇到問題的代碼示例。

這裏是我張貼的jsfiddle代碼:

<!doctype html> 
<html lang="en"> 
<head> 
<meta charset="utf-8"> 
<title>tooltip demo</title> 
<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script> 
<style type="text/css"> 
    .ui-tooltip 
    { 
     padding: 8px; 
     position: absolute; 
     z-index: 9999; 
     max-width: 300px; 
     -webkit-box-shadow: 0 0 5px #aaa; 
     box-shadow: 0 0 5px #aaa; 
     background: black; 
     color: White; 
    } 
    body .ui-tooltip 
    { 
     border-width: 2px; 
    } 
</style> 
</head> 
<body> 
    <p> 
    <a href="#" title="Anchor description">Anchor text</a> 
    <input title="Input help"> 
    </p> 
    <script type="text/javascript"> 
    $(document).tooltip(); 
    </script> 
</body> 
</html> 

回答

3

如果你改變你的jQuery看起來像這樣因爲你希望它會工作(不顯示該專區)。

$(function() { 
    $(document).tooltip(); 
    $(".ui-helper-hidden-accessible").hide(); 
}); 

工作小提琴 - http://jsfiddle.net/LJjDL/

2

它看起來像這樣的預期功能,當你要麼得到解決:

  • 加入jQuery的ui.css的jquery- ui.css文件爲你的元素做樣式並隱藏你所看到的日誌。我updated the jsfiddle與樣式表,我發現here
  • 使用CSS您也可以使用自定義的CSS隱藏元素隱藏元素:.ui-helper-hidden-accessible {display: none}這裏有一個更新的jsfiddle with this solution
+0

由於我的主應用程序配置的方式,我避開了那個css文件。感謝您的幫助,指引我進入.hidden-accessible類的方向。 – Frinavale