jQuery 抄袭笔记(9) : Toggle()
12 Oct 2011</embed>
摘自w3school:
toggle() 方法切换元素的可见状态。
如果被选元素可见,则隐藏这些元素,如果被选元素隐藏,则显示这些元素。
01 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
02 <html xmlns=“http://www.w3.org/1999/xhtml”>
03 </span>
04 <meta http-equiv=“Content-Type” content=“text/html; charset=gb2312″ />
05</span>toggle的用法</title>
06 <script type=“text/javascript” src=“jquery-1.1.3.pack.js”></script>
07 <script type=“text/javascript”>
08 $(document).ready(function(){
09 $(“p”).toggle()
10 });
11 </script>
12 </head>
13 </span>
14
02 <html xmlns=“http://www.w3.org/1999/xhtml”>
03 </span>
04 <meta http-equiv=“Content-Type” content=“text/html; charset=gb2312″ />
05
06 <script type=“text/javascript” src=“jquery-1.1.3.pack.js”></script>
07 <script type=“text/javascript”>
08 $(document).ready(function(){
09 $(“p”).toggle()
10 });
11 </script>
12 </head>
13 </span>
14
</span>Lazynight 这里本来是显示的哦!但是现在通过toggle()它隐藏了!</p>
15 <p style=“display: none”>Lazynight 这里本来是隐藏的哦!但是现在通过toggle()它显示了!</p>
16 </body>
17 </html>
</div>
下载源码
转载请注明:[于哲的博客][1] » [jQuery 抄袭笔记(9) : Toggle()][2]
[1]: http://lazynight.me
[2]: http://lazynight.me/461.html