滑动变色——js和jquery对比
2017-03-09 14:46
239 查看
jQuery方法
<head>
<script src="jquery-1.4.1.js" type="text/JavaScript"></script>
<script type="text/javascript">
$(function () {
// 不需要on——
$(".table1 tr").mouseenter(function () {
$(this).css("backgroundColor", "yellow");
}).mouseleave(function () {
$(this).css("backgroundColor", "white");
});
})
</script>
</head>
<body>
<table class="table1">
<tr>
<td>
喜洋洋
</td>
</tr>
<tr>
<td>
喜洋洋
</td>
</tr>
<tr>
<td>
喜洋洋
</td>
</tr>
<tr>
<head>
<script src="jquery-1.4.1.js" type="text/JavaScript"></script>
<script type="text/javascript">
$(function () {
// 不需要on——
$(".table1 tr").mouseenter(function () {
$(this).css("backgroundColor", "yellow");
}).mouseleave(function () {
$(this).css("backgroundColor", "white");
});
})
</script>
</head>
<body>
<table class="table1">
<tr>
<td>
喜洋洋
</td>
</tr>
<tr>
<td>
喜洋洋
</td>
</tr>
<tr>
<td>
喜洋洋
</td>
</tr>
<tr>
相关文章推荐
- 滑动变色——js和jquery对比
- 滑动变色——js和jQuery对比
- 滑动变色——js和jquery对比
- jQuery实现隔行变色的方法分析(对比原生JS)
- 隔行变色——js和jQuery对比
- 隔行变色——js和jquery对比
- 原始的js代码和jquery对比体会
- JQuery+JS实现仿百度搜索结果中关键字变色效果
- 基于jQuery的表格特效(隔行、滑动、点击变色)
- jquery tmpl.js与 juicer渲染对比
- (2)入门指南——(8)原始的js代码和jquery对比(Plain JavaScript vs. jQuery)
- js与Jquery的对比
- 移动开发中的上下左右滑动插件jquery.swipe.js
- Html js和jquery制作导航条时鼠标快速滑动导致下拉菜单不断执行
- 原生js获取宽高与jquery获取宽高的方法关系对比
- 原始的js代码和jquery对比
- JQuery+JS实现仿百度搜索结果中关键字变色效果
- 博客侧边栏模块跟随滚动条滑动固定效果的实现方法(js+jquery等)
- jQuery避免$符和其他JS库冲突的方法对比