下拉列表中所选选项的描述适用于除Firefox之外的所有浏览器;如何修复
The description of the selected option in dropdown works on all the browsers except Firefox; how to fix it?
<html
<head>
<title>Dropdown tooltip</title>
</head>
<body style="font-size:10pt;font-family:Verdana;">
<script language="javascript">
function showTip(oSel) {
var theTip = document.getElementById("spnTip");
theTip.style.top = window.event.clientY + 20;
theTip.style.left = window.event.clientX;
theTip.innerText = oSel.options[oSel.selectedIndex].text;
theTip.style.visibility = "visible";
}
function hideTip() {
document.getElementById("spnTip").style.visibility = "hidden";
}
</script>
<form>
<select style="width:100px;" onchange="showTip(this)">
<option>Have you seen the latest M. Night Shyamalan film?</option>
<option>It's called The Village.</option>
<option>Although the critics didn't like it, I think it was extremely well done.</option>
<option>You will be kept in suspense even if you think you have figured out the ending.</option>
</select>
<span id="spnTip"
style="position:absolute;visibility:hidden;background:lightyellow;
border:1px solid gray;padding:2px;font-size:8pt;font-family:Verdana;"
onMouseOut="hideTip()"></span>
<br /><br /><br />
</form>
</body>
</html>
CSS left
和top
属性采用长度,而不是数字。你缺少单位。
相关文章:
- 如何修复在浏览器中打开后出现在屏幕上的html/Javascript代码
- 如何修复角度指令顺序(Firefox 和其他浏览器的区别)
- 如何修复更改浏览器选项卡时不同步的可视化
- 如何修复在某些浏览器上停止工作的背景视频
- 修复不同浏览器大小的图像大小
- Javascript / jQuery - 检测浏览器高度 - 简单修复
- 如何将表单“传播”到引导面板的两个区域?(浏览器“修复”未关闭的表单标记)
- 如何从浏览器修复javavascript错误并改进错误日志记录
- CSS或如何修复浏览器具有不同DPI/缩放设置时的外观
- 使用javascript / angularjs在客户端浏览器上修复自定义时区
- 如何修复未定义的cookie值在谷歌浏览器
- 2D图像旋转javascript在所有浏览器中工作.需要帮助修复我的代码
- 无法修复浏览器缩放时滑块移动距离
- iframe打破浏览器后退按钮-如何修复时使用流星
- 如何修复引导导航条固定顶部填充浏览器调整大小
- 以编程方式修复IE中的浏览器模式
- 修复滚动时浏览器窗口顶部的对象
- 当我最小化浏览器窗口时,脚本停止运行.如何修复它
- 移动浏览器初始缩放问题未被元标签修复
- 下拉列表中所选选项的描述适用于除Firefox之外的所有浏览器;如何修复