2013-08-06 58 views
0

我有一個提示,當用戶點擊鏈接時顯示。當顯示提示時,我希望它有一個標題,但不想顯示標題。創建提示標題

$('#spouseMortalityImage').cluetip({ 
    titleAttribute: 'alt', 
    titleAttribute: 'Title', 
    sticky: 'true', 
    closeText: '<img align="right" width="16px" height="16px" src="../images/buttonTip.gif" alt="close" />', 
    closePosition: 'title', 
    ajaxSettings:{ 
     data:{ 
      age:"<%= personalInfoBean.getSpouseAge()%>", 
      gender:"<%= personalInfoBean.getSpouseGender()%>", 
      country:$("input[name=planningCountry]").val(), 
     } 
    } 
}); 

我希望顯示標題,但不顯示標題。這是使用的HTML。

<td class="centerAlignedContext" width="50%"> 
    <pp:text name="personalInfoBean" property="clientMortality" size="8" maxlength="3" style="text-align:center;" styleClass="wamoney" /> 
</td> 
<td width="20%"> 
    <a class="title" href="#" title="Chance of Survival"></a> 
    <img id="clientMortalityImage" style="height:15px;" src="../images/suggestion.jpg" rel="ProbabilityOfSurvival.do"/> 
</td> 
+0

什麼是你的html樣子?你也有兩個'titleAttribute'屬性。 – Jack

回答

2

我從來沒有使用這個插件,但通過文檔,我想提出一些可能的工作改變。 在您的JQuery代碼中,進行以下更改並嘗試:

  • 刪除所有titleAttribute選項。
  • 在您的標記中添加title屬性,如<img id="spouseMortalityImage" title="Hello"/>,您的ID爲spouseMortalityImage,您已在Jquery中顯示該標記。在你目前發佈的標記中,我沒有看到這個元素。相反,我看到一個<img>標籤ID clientMortalityImage
+0

當我將closePosition更改爲'top'時,我的按鈕不顯示,並且showTitle爲true。 –

+1

你的JQuery似乎把線索提示放在ID爲'spouseMortalityImage'的元素上,我想這只是另一個像'clientMortalityImage'這樣的圖像,你已經在你的標記中發佈了。 \t您可以將'closePosition'改回''title''並完全移除您的Jquery中的'titleAttribute'選項。相反,在''標記中添加一個'title'屬性,例如'title =「Hello」',您希望在懸停上顯示提示。 – Gloria

+0

讓我知道如果這個工程。對不起,以前的建議沒有奏效。正如我所說我不熟悉這個插件。 – Gloria