我創建了一個簡單的jQuery toolip:http://jsfiddle.net/oampz/k9THH/生成提示文本/外部文件
我的問題是,我不希望放置img
標籤內的文本,因爲我有20多個工具提示頁面上在每個..很多文本有什麼辦法我可以讓工具提示訪問一個.js文件(或任何其他文件),並從中捕獲必要的文本?
HTML:
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 1" height="20px" />
<br>
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 2" height="20px" />
<br>
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 3" height="20px" />
<br>
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 4" height="20px" />
<br>
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 5" height="20px" />
<br>
<img class="tooltip" src="http://www.katherineemmons.com/wp-content/uploads/2013/06/question_mark-icon.png" title="tool tip text 6" height="20px" />
的jQuery:
$(function() {
$(".tooltip").tooltip({
show: {
effect: "slideDown",
delay: 250
}
});
});
感謝
可以有很多技術,但事實是,你必須編寫文本 –
你想把這個txt文件放在服務器上並讀取它嗎? – anshuVersatile
@dholakiyaankit ..我很高興寫文本,我想要做的不是用我的.HTML文件填充這些文本,而是從某處讀取它們。 –