jquery li练习2-恢复链条
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<script src="jquery-1.7.1.min.js"></script>
<script>
$(function () {
$('li').hover(function () {
//$(this).css('color','red').prevAll().css('color','yellow');//破坏了链
$(this).css('color','red').prevAll().css('color','yellow').end().nextAll().css('color', 'lightBlue');//end()恢复最近断的链条
}, function () {
$('li').css('color', 'black');
}).click(function () {
$(this).appendTo('#ul2');
});
});
</script>
</head>
<body>
<ul id="ul1">
<li>北京</li>
<li>上海</li>
<li>广州</li>
<li>深圳</li>
</ul>
<ul id="ul2">
</ul>
</body>
</html>
最新文章
- C#创建、安装、卸载、调试Windows Service(Windows 服务)的简单教程
- easyui form表单提交应注意的问题
- BeanUtils: 威力和代价(转载)
- 论文笔记Outline
- php Internal Server Error
- AngularJs的UI组件ui-Bootstrap分享(四)——Datepicker Popup
- 去块率波 Deblocking filter
- hashCode()和equals()的用法
- sql之独立子查询和相关子查询总结
- hibernate中持久化对象的生命周期(三态:自由态,持久态,游离态 之间的转换)
- Java线程(学习整理)--2---加入另一个线程join
- vs UNICODE 零散的笔记
- delete和delete[]
- 请教 C# 异步 async await 问题
- 一口一口吃掉Hibernate(七)——继承映射
- Python中list的删除del&;remove小区别
- 学习requests_html
- linux find 10天内改动过的文件
- [Git] Squash all of my commits into a single one and merge into master
- GreenPlum数据加载
热门文章
- WeakRefence
- [React] Public Class Fields with React Components
- Android addTextChangedListener(文本监听)参数解释及实现EditText字数监听
- JS类型转换规则详解
- 单个和多个checkbox选中事件怎么写
- [Django] Get started with Django -- Install python and virtualenv
- js进阶 9-8 html标签如何实现禁止复制和粘贴
- iis配置反向代理oss
- css+html+js实现多级下拉和弹出菜单
- 【t004】切割矩阵