HTML:<select id="selects"> <option selected="selected" id="brazil" onmouseover="tooltip(this)" onmouseout="nodisplay()" onclick="nodisplay()">巴西</option> <option id="usa" onmouseover="tooltip(this)" onmouseout="nodisplay()" onclick="nodisplay()">美国</option> <option id="chn" onmouseover="tooltip(this)" onmouseout="nodisplay()" onclick="nodisplay()">中华人民共和国</option></select><div id="tooltipBlock" style="position: block; display: none;">sdffds</div> JAVASCRIPT: var tip = document.getElementById("tooltipBlock"); var selects = document.getElementById("selects"); function tooltip(obj) { var x = selects.offsetLeft, y = obj.offsetTop, h = obj.offsetHeight, w = selects.offsetWidth; /*tip.style.width = w + "px"; (这部分是定义显示提示的块的宽度) */ tip.style.marginLeft = x + w + "px"; tip.style.marginTop = y - 30 + "px"; tip.style.display = "block"; tip.innerHTML = "这部分为程序传递(把数据库里相关国家资料传过来)"; } function nodisplay() { tip.style.display = "none"; }
详细解决方案
上拉列表<option>中 ONMOUSEOVER显示注释
热度:779 发布时间:2012-11-25 11:44:31.0
HTML:<select id="selects"> <option selected="selected" id="brazil" onmouseover="tooltip(this)" onmouseout="nodisplay()" onclick="nodisplay()">巴西</option> <option id="usa" onmouseover="tooltip(this)" onmouseout="nodisplay()" onclick="nodisplay()">美国</option> <option id="chn" onmouseover="tooltip(this)" onmouseout="nodisplay()" onclick="nodisplay()">中华人民共和国</option></select><div id="tooltipBlock" style="position: block; display: none;">sdffds</div> JAVASCRIPT: var tip = document.getElementById("tooltipBlock"); var selects = document.getElementById("selects"); function tooltip(obj) { var x = selects.offsetLeft, y = obj.offsetTop, h = obj.offsetHeight, w = selects.offsetWidth; /*tip.style.width = w + "px"; (这部分是定义显示提示的块的宽度) */ tip.style.marginLeft = x + w + "px"; tip.style.marginTop = y - 30 + "px"; tip.style.display = "block"; tip.innerHTML = "这部分为程序传递(把数据库里相关国家资料传过来)"; } function nodisplay() { tip.style.display = "none"; }
相关解决方案
- onmouseover onmouseout事件有关问题
- ASP.NET AJAX onmouseover 事件,该如何处理
- onmouseover,onmouseout有关问题
- vb中explicit option 命令,在vb.Net、C#中如何表示?写在那个位置
- OPTION 有关问题
- 怎么为 imagebutton 加上 onmouseover 和 onmouseout 事件
- gcc编译源程序疏失error:unrecognized option 'eh-frame-hdr'
- gcc编译源程序失误error:unrecognized option 'eh-frame-hdr'
- gcc编译源程序出错error:unrecognized option '-eh-frame-hdr'解决思路
- THIS.SETALL('forecolor'RGB(255,255,255),'option'),该如何处理
- THIS.SETALL('forecolor',RGB(255,255,255),'option'),该如何处理
- C:\svn\text\conf\svnserve.conf:20: Option expected是不是版本不对啊求求告诉小弟我版本如何个匹配 啊(活不上去了
- URL里输svn://localhost/svn/tex报错C:\svn\text\conf\svnserve.conf:20: Option expected,该如何解决
- svnserve.conf:12: Option expected的有关问题解决办法
- 施用SVN命令行时,出现config:94:option expected的解决方案
- jQuery获取Select option 取舍的Text和Value
- onmouseover 反应慢 一闪就过去 是为什么
- select option 右首箭头消失
- 一个<select><option>提交时怎么传递两个值啊
- html select 中的 option 上拉列表的宽度, IE8中不能自动适应宽度, 怎么简单解决
- 实现鼠标放到链接上(onmouseover)发出声音的代码解决方法
- 急怎么在JAVASCRIPT中让一个自动添加<option>的多选的下拉列表出来就处于全选状态
- <html:select><html:option><html:options><html:optionsCollection>标签应用
- <html:select><html:option><html:options>标签
- Struts标签<html:select><html:option><html:optionsCollection>跟<html:options>的区别
- jQuery+PHP获取Select option 取舍的Text和Value(附选择城市实例)
- 超链接标签a中 onmouseover 跟 onmouseout ,求解释
- <select><option>中带有图片如何实现
- 关于<select> option 数据源,该如何解决
- Jquery怎么实现向<select>节点中动态增加<option>子节点?