1 / 18
文档名称:

2015年JQuery操作CSS.ppt

格式:ppt   页数:18页
下载后只包含 1 个 PPT 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

2015年JQuery操作CSS.ppt

上传人:3099984911 2015/3/7 文件大小:0 KB

下载得到文件列表

2015年JQuery操作CSS.ppt

文档介绍

文档介绍:JQuery
1
AJFJDSHFDHGKHFKLGHSKHGLKDHGJHLKSHDGJLSHLGDHSLHG
内容摘要
JQuery简介
JQuery选择器
JQuery操作CSS
JQuery完成AJAX应用
2
JQuery简介
jQuery是一个简洁快速的JavaScript库,它能让你在你的网页上简单的操作文档、处理事件、运行动画效果或者添加Ajax交互。
jQuery的设计会改变你写JavaScript代码的方式。
jQuery的语法特点:
匿名回调函数
对象链式操作
3
Hello, JQuery
<a id='b' href=“">hello</a>
<script src=""></script>
<script>
$(document).ready(function(){
$("a").click(function(){
alert('hello!');
return false;
});
});
4
JQuery选择器
使用CSS选择器
使用JQuery方法选择
5
使用CSS选择器选择对象
$(document).ready(function() { $("#orderedlist li:last").hover(function() { $(this).addClass("green"); }, function() { $(this).removeClass("green"); }); });
6
使用CSS选择器选择对象
$(document).ready(function() { $("a[name]").css('background-color','red'); });
$(document).ready(function() { $("a[href*=/content/gallery]").click(function() { // do something with all links that point somewhere to /content/gallery }); });
7
使用JQuery方法选择
Find()
Not()
Is()
Filter()
Each()
……
8
使用JQuery方法选择
$(document).ready(function() { $("#orderedlist").find("li").each(function(i) { $(this).html( $(this).html() + " BAM! " + i ); }); });
$(document).ready(function() { $("li").not("[ul]").css("border", "1px solid black"); });
9
综合应用
$(document).ready(function() { $('#faq').find(‘dd').hide().end().find('dt').click(function() { var answer = $(this).next(); if ((':visible')) { (); } else { (); } }); });
$(document).ready(function() { $("a").hover(function() { $(this).parents("p").addClass("highlight"); }, function() { $(this).parents("p").removeClass("highlight"); }); });
10