<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代码中的一个部门的片段。它列出了多选框中的餐馆。 我想要做的是,我想显示一些关于餐厅的其他细节作为鼠标悬停在列表框或选择餐厅的餐馆名称上的工具提示...工具提示详情如(餐厅城市,或地址,或州) ..那我怎么能表明这一点?谁能告诉我怎么做?
答案 0 :(得分: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等将“标准”工具提示看起来变成一种华丽的外观'感觉'。在鼠标悬停时出现的bobblate。