2014-09-30 19 views
0

首先,我感謝您閱讀我的文章,在HTML選擇列表上的彈出文本

正如我的標題所說,我需要在選項選擇上創建彈出窗口。 我已經在很多jquery教程中進行了搜索,但他們都談論按鈕或標籤來創建彈出窗口。

但是這真的沒有幫助導致這裏的事實是:我所有選中的標籤都在一個標籤中,使得按鈕和標籤無用。因此,我需要當某人用鼠標懸停選定選項中的文本時,每個選項都會出現一個對話框,其中會出現一個對話框,其中顯示了文字的描述,因此這裏是我的代碼:

<select name ="soin" id="soin" size="5"> <!-- the second one, pseudo-dynamic --> 
      <option value="">-----Select-----</option> 
       <option value="Passage" class="Logistique" >Passage</option> 
      <option value="PresenceDansUs" class="Logistique">Présence dans une US</option> 
      <option value="Rangement" class="Logistique">Rangement</option> 
      <option value="Medicarte" class="Logistique">Medicarte</option> 
      <option value="ChercheMateriel" class="Logistique">Cherche du Matériel</option> 
      <option value="Transfert" class="Logistique">Transfert d'un patient</option> 
      <option value="Autre" class="Logistique">Autre</option> 
...there are 50 more values... 
     </option> 

因此,舉例來說,如果有人懸停在「通道」,第一選擇值的鼠標,會出現一個框:「通道是跨越指定位置的方式」等爲他人。 這裏是一個小圖片來幫助你找出思路: enter image description here

,然後對期權價值鼠標 enter image description here

那「對話框中的」用油漆製成,所以請不要拿告訴我,我做了它xD

所以我感謝你的關注,因爲我太低級,不能在jQuery中做這種事情。

回答

1

什麼,你可能會尋找的是<option>標籤的「title」屬性 -

<option value="Passage" title="Passage is a way across a specified location" class="Logistique" >Passage</option> 

Check this fiddle

如果你將鼠標懸停在「通道」選項,你會看到消息作爲一個小工具提示。

+0

我的上帝,它是如此簡單:o 謝謝你V2solutions :) – Carnangel 2014-09-30 09:30:50

相關問題