|
|
???jQuery ?????
???
??????
????????
2.1?ready()???????
2.2?ready()?????????
??????
??????
4.1?hover()??
4.2?toggle()??
??????
??????
6.1???one()
6.2???trigger()
??????
7.1??????????
7.2????????????
??????
??????????
?????????????????????????
??????
???????????????Load????????????????????Click?????????????????????????????????????????????????????????????????
?????????????????????????Capture??????????Bubbling???????????????????????????jQuery??????????????????????????????????????????
????????
2.1?ready()???????
jQuery????????ready()????????JavaScript??OnLoad()??????????????????OnLoad()???????????????????????????????????????????????????????????OnLoad()???????????????????????jQuery??ready()??????????????DOM???????????ready()?????????????????ready()??????JavaScript??OnLoad()???
??????jQuery()??ready()?????????jQuery??????????????isReady??????????????????????ready()????????isReady?????????
????????????????????????????????????????????????????????????????????
2.2?ready()?????????
????
$(document).ready(function() {
//????
})
????
$(function() {
//????
})
????
jQuery(document).ready(function() {
//????
})
????
jQuery(function() {
//????
})
?????????????????
??????
?????????????????????
$(function() {
$("#btnShow").click(function() {
//????
})
})
??????????????jQuery???????bind()????????????????????????
bind()????????????????????????????
bind(type, [data], fn)
?????type??????????????click?change???????????????type???????blur?focus?load?resize?unload?click?dbclick?mousedown?mouseup?mousemove?mouseover?mouseout?mouseenter?mouseleave?change?select?submit?keydown?keypress?keyup?error?
??data???event.data??????????????????
??fn????????????????????
???????????????????????????
??????
?jQuery????????????????????hover()???????toggle()???????????????????????????????????????????????<a>?????????????????????????????????????jQuery??hover()???????
4.1?hover()??
??jQuery??hover()?????????????????????????????????????????jQuery????mouseenter?mouseleave?????
hover()???????????????????????????????????????????????????????????
hover(over, out)
??over????????????????out??????????????
?? ?hover??????
#========================================================================
#FileName: demo12.html
# Author: lowkey
#Email: 361789273@qq.com
#HomePage: http://blog.csdn.net/Iamduoluo
# LastChange: 2012-04-11 14:04:39
#========================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
#HomePage: http://blog.csdn.net/Iamduoluo
# LastChange: 2012-04-11 14:07:49
#========================================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>????toggle</title>
<script src="../jquery.js" type="text/javascript"
charset="utf-8"></script>
<style type="text/css">
body { font-size:13px;}
img { border:1px solid #ccc; padding:3px;}
</style>
<script type="text/javascript" charset="utf-8">
$(function() {
$("img").toggle(function() {
$("img").attr("src", "logo.jpg");
$("img").attr("title", $("img").src);}, function() {
$("img").attr("src", "logo1.jpg");
$("img").attr("title", $("img").src);}, function() {
$("img").attr("src", "logo2.jpg")
$("img").attr("title", $("img").src);})
})
</script>
</head>
<body>
<img src="#" alt="">
</body>
</html>
??????
?DOM????????????????????bind?????????????????????jQuery??????unbind()?????????????????????
unbind()?????????????????????????
unbind([type], [fn])
???jquery?????
??Jquery???
1??????jquery?????(??)
A? ????? B?????? C????? D???????
??:jquery???? (C)
2?DOM?????????????????????(??)
jQuery(expression, [context]) B?jQuery(html, [ownerDocument]) C?jQuery(callback) D?jQuery(elements)
???jquery????? (C)
3????????????????????(??)
A?insertAfter() B?append() C?appendTo() D?after()
???jquery????? (C)
4???????jquery????????(??)
A?each(callback) B?size() C?index(subject) D?index()
??? jquery?????????? ?D?
5?jquery??????size()???????jQuery???_______????.
???jquery?????????? ?length?
6.jquery?$(this).get(0)????__________?????
???jquery?????????? ?$(this)[0]?
7. ?????????
???????hidden????????????(??)
A?visible B?hidden C?visible() D?hidden()
???jquery???? ?B?
8.???????????????????????(??)
A?text() B?contains() C?input() D?attr(name)
???jquery???? ?B?
9.???????????????????????________???????_______???
???jquery???? ?even,odd?
10.?????????????????????????????????????(??)
A?text() B?get() C?eq() D?contents??
???jquery???? ?C?
11.??????????????????????_________???????????_________???
???jquery???? ?first,eq(1)?
12.???????jquery????????
A??? B??? C??? D???
???jquery??? (B)
13.????????jquery?????? ????
A??? B??? C??? D????????
???jquery????? (ABD)
14.?????????????????????????????????
A?append(content) B?appendTo(content) C?insertAfter(content) D?after(content) ???jquery????? (D)
15.?jquery???????????????????????______?????????????????___________??
???jquery??? ?is(expr),false?
16.?jquey???????DOM?????????????????????????
A?delete() B?empty() C?remove() D?removeAll()
???jquery????? ?C?
17.?jquery????????????????????????????????
A?first B?eq(1) C?css(name) D?css(name,value)
??? jquery?css?? ?C?
18.???????????????????????????????_________????????????????????________?__________?
???jquery?css?? ?offset,top,left?
19.?jquery????????????????????????????? ????
A?width() B?width(val) C?width D?innerWidth()
???jquery?css?? ?A?
20.?????????????div??????????????____________________________?
???jquery?css?? ($(div).css(color,green))
21.???????????????click??????????????????????????? ????
A?trigger (type) B?bind(type) C?one(type) D?bind
???jquery????? (B)
22??jquery??????????????????????????????????______________?
???jquery????? (hover(over,out))
23.?????????jquery?????? (??)
A?bind(type) B?click() C?change() D?one(type)
???jquery????? (BC)
24.????????????????????????????????????? (??)
A?hover(over ,out) B?keypress?fn? C?change() D?change(fn)
???jquery????? (D)
25.????????????????????????????????????????????
A?click(fn) B?change(fn) C?select(fn) D?bind(fn)
???jquery????? (C)
26.?jquery????????????________???????????_________??? ???jquery????? ?hide(),show()?
27.????????600????????????__________________________________????
???jquery????? ?$(p).slideUp(slow)?
28.?jquery???????????????___________________________?????? ???jquery????? (animate(params, options))
29.?jquery?????????http get??????????????????? (??)
A?$.ajax() B?load(url) C?$.get(url) D?$. getScript(url)
???jquery?ajax (C)
30.?????ajax????? (??)
A?ajaxComplete(callback) B?ajaxSuccess(callback) C?$.post(url) D?ajaxSend(callback) ???jquery?ajax ?C?
31.???jQuery?????????___________________?????
???jquery????? ($.noConflict(extreme))
32.??????????????input??????jquery??____________________????
???jquery?????:not()?
33.??????jquery?????????????
A?:checked B?: enabled C?:hidden D?:selected E?:file F?: disabled
???jquery?????ABDF?
34.?jquery???????/??????????????????????________________???
???jquery?????? ?attr(pro)?
35.?jquery?????????????????????????????????????????????????????
A?removeClass() B?deleteClass() C?toggleClass(class) D?addClass()
???jquery??? ?C?
36.?jquery???????????????????????????????
A?eq(index) B?find(expr) C?siblings([expr]) D?next()
???jquery??? ?C?
?????? jQuery????
??? jQuery????
??????
1???jQuery????????
2???jQuery????????????????? 3???jQuery?????????? ??????
1?????????? 2????????
??????
1??????????????????????????????????????????????3-1???
?3-1
?????
photo.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/retype/zoom/b0334d7c011ca300a6c39013?pn=3&x=0&y=0&raww=321&rawh=158&o=png_6_0_0_240_216_412_204_892.979_1262.879&type=pic&aimh=158&md5sum=8c35738dd8cffeb22a458bf2ec51b9aa&sign=89d9164497&zoom=&png=55932-57465&jpg=0-0" target="_blank">????
?3-2
?????
table.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/retype/zoom/b0334d7c011ca300a6c39013?pn=4&x=0&y=0&raww=445&rawh=151&o=png_6_0_0_236_750_420_142_892.979_1262.879&type=pic&aimh=151&md5sum=8c35738dd8cffeb22a458bf2ec51b9aa&sign=89d9164497&zoom=&png=57466-58150&jpg=0-0" target="_blank">????
?????
menu.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
1.0 Transitional//EN"
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>???</title><style type="text/css"> .mainmenu {
float:left;width:200px; list-style-type:none; margin-right:5px;} li.mainmenu ul { margin:0;}
a { width:200px; display:block; text-decoration:none; background:#00f; color:#fff; padding:0.5em; border-bottom:1px solid #fff;}
ul#dropdownmenu li a:hover{ background:#000;} li{ list-style-image:none; }</style>
<script type="text/javascript" src="js/jquery-1.4.2.js"></script><script type="text/javascript">
$(document).ready(function() { $(".mainmenu ul").hide();
$(".mainmenu ").bind("mouseenter mouseleave", function() {
$("ul", this).toggle(); }); });</script> </head> <body>
<ul id="dropdownmenu"> <li class="mainmenu"> <a href="">Books</a> <ul>
<li><a href="">web development</a></li><li><a href="">Programming</a></li><li><a href="">RDBMS</a></li> </ul> </li>
<li class="mainmenu">
<a href="">Movies</a> <ul>
<li><a href="">Latest Movie Trailers</a></li><li><a href="">Movie Reviews</a></li><li><a href="">Celebrity Interviews</a></li> </ul> </li>
?JQuery?Bind()??????????????
?????http://www.850500.com/news/69703.html
?????,??! |
|