IE6中下拉菜单的工具提示 [英] Tool Tip for dropdown in IE6
本文介绍了IE6中下拉菜单的工具提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含项目列表的下拉列表
每当我选择任何项目时,我都需要在列出的项目上获得工具提示",
以下是我编写的代码,该代码适用于Internet Explorer 7.0
不适用于IE 6.0,
请给我发送Internet exp 6.0的代码.
Hi,
i have a drop down list with list of items
when ever i select any item i need to get TOOL TIP on that listed items,
below is the code which i have written this is working for internet explorer 7.0
not working for IE 6.0,
please can u send the code for internet exp 6.0.
for (int i = 0; i < ddl Country.Items.Count; i++)
ddl Country.Items.Attributes.Add("title", ddl Country.Items.Text);
推荐答案
DropDownLists上的工具提示存在很多困惑.这是事实.
Windows的IE不支持Tooltip属性,甚至不支持< select>上的title属性.控制.这是因为它们为< select>创建了一个单独的窗口.标签位于浏览器窗口上其余信息的上方. (将其视为另一层.)工具提示引擎实际上位于主窗口层上,因此工具提示将显示在< select>之后.元素(如果要显示).该分层行为还破坏了位于< select>上方的弹出窗口.标签,因为它们始终在主窗口层上!
W3C规范完全支持title =属性,Mozilla,FireFox,Netscape和Safari等基于DOM的浏览器都使用该规范.因此,通过分配myDropDownList.Attributes.Add("title","text"),您将在这些浏览器上获得工具提示!
最后,仅当用户未指向< select>时,才建议使用属性将
There is a lot of confusion about tooltips on DropDownLists. Here''s the facts.
IE for Windows does not support the Tooltip property or even the title attribute on the <select> control. This is because they create a separate window for the <select> tag that is above the rest of the info on the browser window. (Think of it as another layer.) The tooltip engine is actually on the main window layer, so the tooltip would appear behind the <select> element if it was to appear. This layered behavior also breaks popups that position over <select> tags because they are always on the main window layer!
The title= attribute is fully supported in the W3C specification, which is used by the DOM-based browsers like Mozilla, FireFox, Netscape, and Safari. So by assigning myDropDownList.Attributes.Add("title", "text"), you will get a tooltip on those browsers!
Finally, the suggestion to enclose the DropDownList in the
with a title= attribute will only work so long as the user does not point to the <select> element itself because of the layering problem.
We can only hope Microsoft puts <select> tags into the same layer in a future version of IE...
Credit goes to PLBlum
We can only hope Microsoft puts <select> tags into the same layer in a future version of IE...
Credit goes to PLBlum
此处是服务器端代码,与任何浏览器无关.问题(如果有的话)是在生成的html中.
This is server-side code and has nothing to do with any browser. The problem, if any, is in the html that is generated.
这篇关于IE6中下拉菜单的工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文