我在 jsp 页面中有一个表格,其中有很多行和列,我想让访问者在我的页面上保持导向,当他们将鼠标移到行或列上时,应该用不同的背景颜色突出显示。
我的**悬停功能**
代码在其他浏览器(如 crome、firefox)上运行良好,但在 IE
上运行不正常,我需要保持 content="IE-5 "
这是我的代码:
<meta http-equiv="X-UA-Compatible" content="IE=5" />
<script type="text/javascript"
src="javascripts/jquery/jquery-1.5.1.min.js"></script>
<script type="text/javascript"
src="javascripts/jquery/jquery-ui-1.8.12.custom.min.js"></script>
$(document).ready(function() {
$('#reportDashBoardTable tr').hover(
function () {
$(this).addClass('hover');
},
function () {
$(this).removeClass('hover');
}
);
});
<style type="text/css">
.hover { background-color:#B0C4DE; }
</<style>
我如何为所有版本的 IE 做到这一点?
提前致谢!
阿南德
最佳答案
为什么不使用 CSS?几乎每个 IE 版本都应该支持它(3 以下的除外)
#reportDashBoardTable :hover { background-color:#B0C4DE; }
关于javascript - 使用带有 IE 的 JQuery 在悬停时突出显示表行 - 所有版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28343019/