您现在的位置: 万盛学电脑网 >> 程序编程 >> 脚本专题 >> javascript >> 正文

jQuery实现鼠标划过修改样式的方法

作者:佚名    责任编辑:admin    更新时间:2022-06-22

 本文实例讲述了jQuery实现鼠标划过修改样式的方法。分享给大家供大家参考。具体如下:

1 2 3 4 5 6 7 8 9 10 11 12 $(document).ready(function () { //默认情况下样式 $("input:text").attr("style","border:1px solid #7E9DB9;"); //鼠标移入样式 $("input:text").mouseover(function () { $(this).attr("style","border:1px solid #EDBB72;"); }); //鼠标移开样式 $("input:text").mouseout(function () { $(this).attr("style","border:1px solid #7E9DB9;"); }); });