您的位置:首页 > Web前端 > JQuery

鼠标经过表格行时,显示变色、字体放大效果 jquery

2011-07-29 10:03 721 查看
方法1:

<script type="text/javascript">

$("#table_tr tr").mousemove(function() {

$(this).css("backgroundColor", "#E6E6FA");

$(this).css("fontWeight", "bolder");

});

$("#table_tr tr").mouseout(function() {

$(this).css("backgroundColor", "#FFFFFF");

$(this).css("fontWeight", "normal");

});

</script>

方法2:

<script type="text/javascript">

$("#table_tr tr").hover(

function () { $(this).css({'background-color' : '#E6E6FA', 'font-weight' : 'bolder'});},

function () { $(this).css({'background-color' : '#FFFFFF','font-weight' : 'normal'});}

);

</script>

方法3:(速度最快)

<tr onmouseover="this.style.backgroundColor='#E6E6FA';this.style.fontWeight='bolder';"

onmouseout="this.style.backgroundColor='#FFFFFF';this.style.fontWeight='normal';">
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: