2013-01-07 77 views
0
<div class="span3"> 
       <label>Restaurants <span class="f_req">*</span></label> <select 
        id="rest_id" name="rest_id" 
        data-placeholder="- Select Restaurants -" class="chzn-select"multiple "> 
        <% 
         List <restaurant> rest_list=restaurantLocalServiceUtil.getAllRestaurantByOrganizationId(themeDisplay);               
                 for(int i=0;i<rest_list.size();i++) { 
        %> 
        <option id="<%=rest_list.get(i).getPrimaryKey()%>" 
         value=<%=rest_list.get(i).getPrimaryKey()%>><%=rest_list.get(i).getName().toString()%> 
        </option> 
        <% 
         } 
        %> 
       </select> <span id="restError3" style="color: #C62626;" class="help-block"></span> 
      </div> 

以上是我在jsp代码中的一个分部的片段,它列出了多选框中的餐厅。 我想要做的是,我想展示一些关于餐厅的其他细节,作为鼠标悬停在餐厅名称上的列表框或选择餐厅的工具提示...工具提示详细信息,如(餐厅城市或地址,或状态) ..我如何显示?有谁能告诉我该怎么做吗?如何使用jsp在多选框上显示工具提示?

回答

2

工具提示由HTML元素的title属性表示。

例如,

<option value="42" title="This is option with label 'Foo' and ID 42">Foo</option> 

我不知道为什么你这个标记jQuery的,但如果你想花式,然后随便挑了许多可用jQuery tooltip plugins之一。但请注意,几乎所有这些都是基于HTML元素title属性的值。他们唯一有效的做法是通过删除title属性并烘烤一堆<div>和CSS等锅炉板,将其显示在鼠标上,从而将“标准”工具提示look'n'feel变成一些华丽的look'n'feel。