jQuery Getting Started
来源:互联网 发布:索尼 网络授权经销商 编辑:程序博客网 时间:2024/04/29 16:41
"jQuery is a fast, small, and feature-rich JavaScript library."
1.Google CDN
<head><script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script></head>
2.jQuery Syntax
$(document).ready(function(){ $("p").click(function(){ $(this).hide(); });});
3. jQuery selector
3.1 Element selector
$("p")$("button")
3.2 ID selector
$("#id")
3.3 class selector
$(".class")
4. DOM Events
5. on() Method
The on() method attaches one or more event handlers for the selected elements.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script><script>$(document).ready(function(){ $("p").on({ mouseenter: function(){ $(this).css("background-color", "lightgray"); }, mouseleave: function(){ $(this).css("background-color", "lightblue"); }, click: function(){ $(this).css("background-color", "yellow"); } });});</script>
6. jQuery Effect Methods
0 0
- jQuery Getting Started
- Tutorials:Getting Started with jQuery---1
- Tutorials:Getting Started with jQuery---2
- Tutorials:Getting Started with jQuery---3
- Tutorials:Getting Started with jQuery---4
- jQuery:Installation, Overview, and Getting Started
- Getting started
- Getting Started
- Getting Started
- Getting Started
- Getting Started
- getting started
- Getting Started
- Getting Started
- Getting Started
- Getting Started
- jQuery Notes (getting started with jQuery, examples of selectors)
- Getting started with the Nivo Slider jQuery Plugin
- 外贸项目之绣花鞋
- mysql学习之触发器
- 黑马程序员_打印流和序列流
- 跟我学习dubbo-使用Maven构建Dubbo服务的可执行jar包(4)
- [Machine Learning] Generative learning algorithm-GDA and NB
- jQuery Getting Started
- JavaWeb: Redis存储Session方案
- 黑马程序员_文件的分割和合并
- C++ Overloading (Operator and Function)
- C++ function overriding
- Memory Layout of C programs
- 结构体中的 char *name & char name[20]
- Memory : Stack vs Heap
- 黑马程序员_IO流(对象的序列化和反序列化)