<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
</style>
<script src="js/jquery-2.1.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/ChangeColor.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
/*jQuery.extend(object); 为jQuery添加类方法,可以理解为添加静态方法。如:
$.extend({
add:function(a,b){return a+b;}
});
便为 jQuery 添加一个为 add 的 “静态方法”,之后便可以在引入 jQuery 的地方,使用这个方法了,
$.add(3,4); //return 7
第二种:jQuery.fn.extend(object); 对jQuery.prototype进行扩展,就是为jQuery类添加“成员函数”。jQuery类的实例可以使用这个“成员函数”。
*
*
*/
$(document).ready(function() {
// $("div").click(function(){
// $(this).css({
// width:"200px",
// height:"200px",
// backgroundColor:"red",
// })
// })
// $("div").click(function(){
// $(this).change()
// })
$("div").change1("blue")
// $("a").click(function(){
// $(this).css({
// backgroundColor:"green",
// })
// })
// $("p").mouseover(function(){
// $(this).css({
// backgroundColor:"yellow"
// })
// })
$("a").change2("click", {
backgroundColor: "pink"
})
$("h1").change2("click", {
backgroundColor: "yellow"
})
})
</script>
</head>
<body>
<div>divdiv</div>
<a href="####">aaaa</a>
<p>ppppppppp</p>
<h1>hhhhhhhhhhhh</h1>
</body>
</html>