2015-08-19 35 views
0

enter image description here隱藏默認的標題提示

我們可以看到上面的圖片,在「創建」按鈕,懸停,兩名提示來了。這裏我不想要默認工具提示(下面的小提示)。

我想只顯示我的自定義工具提示

我的代碼:

<style> 
 
button[title]:hover:before { 
 
    content: attr(title); 
 
    padding: 2px 2px; 
 
    color: #333; 
 
    position: absolute; 
 
    left: 100px; 
 
    top: 320px; 
 
    z-index: 20; 
 
    white-space: nowrap; 
 
    -moz-border-radius: 2px; 
 
    -webkit-border-radius: 2px; 
 
    border-radius: 2px; 
 
    -moz-box-shadow: 0px 0px 4px #222; 
 
    -webkit-box-shadow: 0px 0px 4px #222; 
 
    box-shadow: 0px 0px 4px #222; 
 
    background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); 
 
    background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #eeeeee),color-stop(1, #cccccc)); 
 
    background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); 
 
    background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); 
 
    background-image: -ms-linear-gradient(top, #eeeeee, #cccccc); 
 
    background-image: -o-linear-gradient(top, #eeeeee, #cccccc); 
 
} 
 
    </style> 
 

 
<button onclick="setActionAndSubmit('id_form_workitem_create', 'create');" title="please fill all mandatory fields"> 
 
\t \t \t \t \t \t \t \t \t \t Create 
 
</button>

請幫幫忙,謝謝提前

+2

http://stackoverflow.com/questions/19746767/hide-title-from-tooltip – sinisake

+0

感謝.. worthful鏈接:) –

回答

0

你想要的取出來自你的標題屬性 - 如果你刪除它屬性會擺脫它,但是您必須更改您的選擇器並對您的內容進行硬編碼,因爲這兩者都依賴於那裏的標題。

2

顯示的小工具提示正在顯示,因爲您在DOM節點中設置了title屬性。在下面的JSFiddle中,提出的解決方案是更改在按鈕和CSS中保存工具提示內容的屬性。

JSFiddle