jQuery鼠标滑过tr,会高亮显示当前商品,提高用户体验,这就是我们常用的隔行换色的效果,也是前端必学的一个小技能。
淘建站为您提供更多_其它特效_jQuery插件_隔行_高亮,在此特别感谢您对我们的支持与厚爱!
演示不了,点击反馈
下载 114 次
觉得不错,可打赏下作者
免费共享
//表格 移动变换背景 显示按钮 空间页面
function space_table($table, $showbg, $showbgTop, $lastTr, $absolute_border, $tdWidth, $firstWidth) {
$table.mousemove(function(e) {
var index = $(e.target).index();
//如果是第一列 则return
if (index == 0)
return;
if (e.target.tagName != "TD") {
return false;
}
$showbg.css("left", ((index - 1) * $tdWidth + $firstWidth) + "px");
//获取当前td所在的列的第一个td 然后给其赋值给绝对定位的div 显示在上层
var firstTd_val = $table.find("tr").first().find("td").eq(index).html();
$showbgTop.html(firstTd_val);
//获取表格高度并赋值给绝对定位的div
$absolute_border.height(($table.height() - 44) + "px");
//判断$lastTr参数是否为空,如果不为空,则鼠标移上去显示 ul 其它ul隐藏
($lastTr) && ($lastTr.find("ul").hide(), $lastTr.find("td").eq(index).children("ul").show());
})
}

