jqueryの簡単なdiv表示と非表示の特効
1933 ワード
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5<title> </title>
6<script src="jquery_last.js" type="text/javascript"></script>
7<script type="text/javascript">
8$(document).ready( function(){});
9function hiden(){
10$("#divObj").hide();//hide() , , ( ) hide(2000) 2000 , slow,fast
11}
12function slideToggle(){
13$("#divObj").slideToggle(2000);// , , , ,
14}
15function show(){
16$("#divObj").show();// ,
17}
18function toggle(){
19$("#divObj").toggle(2000);// , ,
20
21}
22function slide(){
23$("#divObj").slideDown();//
24}
25
26</script>
27</head>
28
29<body>
30<h3>div </h3>
31 <input type="button" value=" " onclick="hiden()"/>
32 <input type="button" value=" " onclick="show()"/>
33 <input type="button" value=" 2" onclick="slide()"/>
34 <input type="button" value=" " onclick="slideToggle()"/>
35 <input type="button" value=" " onclick="toggle()"/>
36<div id="divObj" style="display:none">
37 1. <br/>
38 2. <br/>
39 3. <br/>
40 4. <br/>
41 5. <br/>
42 6. <br/>
43 7. <br/>
44 8. <br/>
45 9. <br/>
46 0. <br/>
47 </div>
48</body>
49</html>