File tree Expand file tree Collapse file tree 3 files changed +57
-31
lines changed Expand file tree Collapse file tree 3 files changed +57
-31
lines changed Original file line number Diff line number Diff line change 7
7
< style >
8
8
.left div ,
9
9
.right div {
10
- width : 500 px ;
10
+ width : 100 % ;
11
11
height : 50px ;
12
12
padding : 5px ;
13
13
margin : 5px ;
14
14
float : left;
15
15
border : 1px solid # ccc ;
16
16
display : none;
17
17
}
18
-
19
18
.left div {
20
19
background : # bbffaa ;
21
20
}
24
23
background : yellow;
25
24
}
26
25
</ style >
27
- < script src ="http://libs.baidu .com/jquery/1.9.1/jquery.js "> </ script >
26
+ < script src ="http://lib.sinaapp .com/js/ jquery/1.9.1/jquery-1.9.1.min .js "> </ script >
28
27
</ head >
29
28
30
29
< body >
31
30
< h2 > slideDown</ h2 >
32
31
< div class ="left ">
32
+ < h4 > 测试一</ h4 >
33
33
< div id ="a1 "> hide-show</ div >
34
34
< button > 点击slideDown显示动画</ button >
35
35
< script type ="text/javascript ">
36
36
//点击buttom
37
37
//执行3秒隐藏
38
38
//执行3秒显示
39
- $ ( "button" ) . click ( function ( ) {
39
+ $ ( "button:first " ) . click ( function ( ) {
40
40
$ ( "#a1" ) . slideDown ( 3000 )
41
41
} ) ;
42
+ </ script >
42
43
43
-
44
+ < h4 > 测试二</ h4 >
45
+ < div id ="a2 "> hide-show</ div >
46
+ < button > 点击slideDown执行回调</ button >
47
+ < script type ="text/javascript ">
48
+ //点击buttom
49
+ //执行3秒隐藏
50
+ //执行3秒显示
51
+ $ ( "button:last" ) . click ( function ( ) {
52
+ $ ( "#a2" ) . slideDown ( 3000 , function ( ) {
53
+ alert ( '动画执行结束' )
54
+ } )
55
+ } ) ;
44
56
</ script >
45
57
</ body >
46
58
59
+
47
60
</ html >
Original file line number Diff line number Diff line change 7
7
< style >
8
8
.left div ,
9
9
.right div {
10
- width : 500 px ;
10
+ width : 100 % ;
11
11
height : 50px ;
12
12
padding : 5px ;
13
13
margin : 5px ;
29
29
< body >
30
30
< h2 > slideUp</ h2 >
31
31
< div class ="left ">
32
+ < h4 > 测试一</ h4 >
32
33
< div id ="a1 "> </ div >
33
34
< button > 点击slideUp隐藏动画</ button >
34
35
< script type ="text/javascript ">
35
36
//点击buttom
36
37
//执行3秒隐藏
37
38
//执行3秒显示
38
- $ ( "button" ) . click ( function ( ) {
39
+ $ ( "button:first " ) . click ( function ( ) {
39
40
$ ( "#a1" ) . slideUp ( 3000 )
40
41
} ) ;
42
+ </ script >
41
43
42
-
44
+ < h4 > 测试二</ h4 >
45
+ < div id ="a2 "> </ div >
46
+ < button > 点击slideUp执行回调</ button >
47
+ < script type ="text/javascript ">
48
+ //点击buttom
49
+ //执行3秒隐藏
50
+ //执行3秒显示
51
+ $ ( "button:last" ) . click ( function ( ) {
52
+ $ ( "#a2" ) . slideUp ( 3000 , function ( ) {
53
+ alert ( '动画执行结束' )
54
+ } )
55
+ } ) ;
43
56
</ script >
57
+
44
58
</ body >
45
59
46
60
</ html >
Original file line number Diff line number Diff line change 7
7
< style >
8
8
.left div ,
9
9
.right div {
10
- width : 500 px ;
10
+ width : 100 % ;
11
11
height : 50px ;
12
12
padding : 5px ;
13
13
margin : 5px ;
29
29
< body >
30
30
< h2 > hide</ h2 >
31
31
< div class ="left ">
32
-
32
+ < h4 > 测试一 </ h4 >
33
33
< div id ="a1 "> hide操作</ div >
34
+ < button > 直接hide</ button >
35
+ < script type ="text/javascript ">
36
+ //点击buttom1 直接隐藏
37
+ $ ( "button:first" ) . click ( function ( ) {
38
+ $ ( "#a1" ) . hide ( )
39
+ } ) ;
40
+ </ script >
34
41
35
- < div id ="a2 "> hide动画操作</ div >
36
42
37
- < button > 直接hide</ button >
43
+ < h4 > 测试一</ h4 >
44
+ < div id ="a2 "> hide动画操作</ div >
38
45
< button > hide带动画</ button >
46
+ < script type ="text/javascript ">
47
+ //点击buttom2 执行动画隐藏
48
+ $ ( "button:last" ) . click ( function ( ) {
49
+ $ ( "#a2" ) . hide ( {
50
+ duration : 3000 ,
51
+ complete : function ( ) {
52
+ alert ( '执行3000ms动画完毕' )
53
+ }
54
+ } )
55
+ } ) ;
56
+ </ script >
39
57
</ div >
40
- < script type ="text/javascript ">
41
-
42
- //点击buttom1 直接隐藏
43
- $ ( "button:first" ) . click ( function ( ) {
44
- $ ( "#a1" ) . hide ( )
45
- } ) ;
46
-
47
- //点击buttom2 执行动画隐藏
48
- $ ( "button:last" ) . click ( function ( ) {
49
- $ ( "#a2" ) . hide ( {
50
- duration :3000 ,
51
- complete :function ( ) {
52
- alert ( '执行3000ms动画完毕' )
53
- }
54
- } )
55
- } ) ;
56
-
57
-
58
- </ script >
59
58
</ body >
60
59
61
60
</ html >
You can’t perform that action at this time.
0 commit comments