吉吉于

jQuery 抄袭笔记(10) : Toggle()(2)

点击链接显示/隐藏选中对象。可以利用这个实现侧栏项目的显示/隐藏。



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>Hello Lazynight!<span style="color: rgb(255, 68, 0); font-weight: bold; "></title></span><br /><span style="color: rgb(105, 105, 105); ">06</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "><script </span><span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(209, 56, 0); ">"text/javascript"</span> <span style="color: rgb(255, 255, 0); ">src=</span><span style="color: rgb(209, 56, 0); ">"jquery-1.1.3.pack.js"</span><span style="color: rgb(255, 68, 0); font-weight: bold; ">></script></span><br /><span style="color: rgb(105, 105, 105); ">07</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "><script </span><span style="color: rgb(255, 255, 0); ">type=</span><span style="color: rgb(209, 56, 0); ">"text/javascript"</span><span style="color: rgb(255, 68, 0); font-weight: bold; ">></span><br /><span style="color: rgb(105, 105, 105); ">08</span> <span style="color: rgb(192, 192, 192); ">$</span>(<span style="color: rgb(192, 192, 192); ">document</span><span style="color: rgb(192, 192, 192); ">).</span><span style="color: rgb(192, 192, 192); ">ready</span>(<span style="color: rgb(255, 68, 0); font-weight: bold; ">function</span><span style="color: rgb(192, 192, 192); ">(){</span><br /><span style="color: rgb(105, 105, 105); ">09</span>     <span style="color: rgb(192, 192, 192); ">$</span>(<span style="color: rgb(209, 56, 0); ">"a"</span><span style="color: rgb(192, 192, 192); ">).</span><span style="color: rgb(192, 192, 192); ">toggle</span>(<span style="color: rgb(255, 68, 0); font-weight: bold; ">function</span><span style="color: rgb(192, 192, 192); ">(){</span><br /><span style="color: rgb(248, 16, 176); ">10</span>         <span style="color: rgb(192, 192, 192); ">$</span>(<span style="color: rgb(209, 56, 0); ">"#text"</span><span style="color: rgb(192, 192, 192); ">).</span><span style="color: rgb(192, 192, 192); ">hide</span>(<span style="color: rgb(209, 56, 0); ">'slow'</span><span style="color: rgb(192, 192, 192); ">);},</span><br /><span style="color: rgb(105, 105, 105); ">11</span>         <span style="color: rgb(255, 68, 0); font-weight: bold; ">function</span><span style="color: rgb(192, 192, 192); ">(){</span><br /><span style="color: rgb(105, 105, 105); ">12</span>         <span style="color: rgb(192, 192, 192); ">$</span>(<span style="color: rgb(209, 56, 0); ">"#text"</span><span style="color: rgb(192, 192, 192); ">).</span><span style="color: rgb(192, 192, 192); ">show</span>(<span style="color: rgb(209, 56, 0); ">'fast'</span>);<br /><span style="color: rgb(105, 105, 105); ">13</span>     <span style="color: rgb(192, 192, 192); ">});</span><br /><span style="color: rgb(105, 105, 105); ">14</span> <span style="color: rgb(192, 192, 192); ">});</span><br /><span style="color: rgb(248, 16, 176); ">15</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></script></span><br /><span style="color: rgb(105, 105, 105); ">16</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></head></span><br /><span style="color: rgb(105, 105, 105); ">17</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "><body></span><br /><span style="color: rgb(105, 105, 105); ">18</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "><a</span> <span style="color: rgb(255, 255, 0); ">href=</span><span style="color: rgb(209, 56, 0); ">"http://lazynight.me"</span><span style="color: rgb(255, 68, 0); font-weight: bold; ">></span><br /><span style="color: rgb(105, 105, 105); ">19</span> Everytime it rains-Ace Of Base<br /><span style="color: rgb(248, 16, 176); ">20</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></a></span><br /><span style="color: rgb(105, 105, 105); ">21</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "><div</span> <span style="color: rgb(255, 255, 0); ">id=</span><span style="color: rgb(209, 56, 0); ">"text"</span><span style="color: rgb(255, 68, 0); font-weight: bold; ">></span><br /><span style="color: rgb(105, 105, 105); ">22</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "><pre></span><br /><span style="color: rgb(105, 105, 105); ">23</span> I see dark clouds out my window<br /><span style="color: rgb(105, 105, 105); ">24</span> I know the storm is coming any minute<br /><span style="color: rgb(248, 16, 176); ">25</span> And the thunder just confirms my fears<br /><span style="color: rgb(105, 105, 105); ">26</span> And I know the tears are in there<br /><span style="color: rgb(105, 105, 105); ">27</span> I'll be crying unable to stop<br /><span style="color: rgb(105, 105, 105); ">28</span> Look here comes the very first drop <br /><span style="color: rgb(105, 105, 105); ">29</span> <br /><span style="color: rgb(248, 16, 176); ">30</span> 'Cause every time it rains<br /><span style="color: rgb(105, 105, 105); ">31</span> I fall to pieces<br /><span style="color: rgb(105, 105, 105); ">32</span> So many memories the rain releases<br /><span style="color: rgb(105, 105, 105); ">33</span> I feel you… I taste you<br /><span style="color: rgb(105, 105, 105); ">34</span> I cannot forget<br /><span style="color: rgb(248, 16, 176); ">35</span> Every time it rains… I get wet <br /><span style="color: rgb(105, 105, 105); ">36</span> <br /><span style="color: rgb(105, 105, 105); ">37</span> Darling I am still in love with you<br /><span style="color: rgb(105, 105, 105); ">38</span> As time passes by it just intensifies<br /><span style="color: rgb(105, 105, 105); ">39</span> I know I'll never be with you again<br /><span style="color: rgb(248, 16, 176); ">40</span> I'll never find another with that kindness in his eyes<br /><span style="color: rgb(105, 105, 105); ">41</span> I'll be trying unable to stop<br /><span style="color: rgb(105, 105, 105); ">42</span> Look here comes the very first drop <br /><span style="color: rgb(105, 105, 105); ">43</span> <br /><span style="color: rgb(105, 105, 105); ">44</span> 'Cause every time it rains<br /><span style="color: rgb(248, 16, 176); ">45</span> I fall to pieces<br /><span style="color: rgb(105, 105, 105); ">46</span> So many memories the rain releases<br /><span style="color: rgb(105, 105, 105); ">47</span> I feel you… I taste you<br /><span style="color: rgb(105, 105, 105); ">48</span> I cannot forget<br /><span style="color: rgb(105, 105, 105); ">49</span> Every time it rains… I get wet <br /><span style="color: rgb(248, 16, 176); ">50</span> <br /><span style="color: rgb(105, 105, 105); ">51</span> On sunny days I'm all right<br /><span style="color: rgb(105, 105, 105); ">52</span> I walk in the light<br /><span style="color: rgb(105, 105, 105); ">53</span> And i try not to think about<br /><span style="color: rgb(105, 105, 105); ">54</span> The love I live without <br /><span style="color: rgb(248, 16, 176); ">55</span> <br /><span style="color: rgb(105, 105, 105); ">56</span> But every time it rains<br /><span style="color: rgb(105, 105, 105); ">57</span> I fall to pieces<br /><span style="color: rgb(105, 105, 105); ">58</span> So many memories the rain releases<br /><span style="color: rgb(105, 105, 105); ">59</span> I feel you… I taste you<br /><span style="color: rgb(248, 16, 176); ">60</span> I cannot forget<br /><span style="color: rgb(105, 105, 105); ">61</span> Every time it rains… I get wet<br /><span style="color: rgb(105, 105, 105); ">62</span> 'Cause every time it rains<br /><span style="color: rgb(105, 105, 105); ">63</span> I fall to pieces<br /><span style="color: rgb(105, 105, 105); ">64</span> So many memories the rain releases<br /><span style="color: rgb(248, 16, 176); ">65</span> I feel you… I taste you<br /><span style="color: rgb(105, 105, 105); ">66</span> I cannot forget<br /><span style="color: rgb(105, 105, 105); ">67</span> Every time it rains… I get wet<br /><span style="color: rgb(105, 105, 105); ">68</span> 'Cause every time it rains<br /><span style="color: rgb(105, 105, 105); ">69</span> I fall to pieces<br /><span style="color: rgb(248, 16, 176); ">70</span> So many memories the rain releases<br /><span style="color: rgb(105, 105, 105); ">71</span> I feel you… I taste you<br /><span style="color: rgb(105, 105, 105); ">72</span> I cannot forget<br /><span style="color: rgb(105, 105, 105); ">73</span> Every time it rains… I get wet<br /><span style="color: rgb(105, 105, 105); ">74</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></pre></span><br /><span style="color: rgb(248, 16, 176); ">75</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></div></span><br /><span style="color: rgb(105, 105, 105); ">76</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></body></span><br /><span style="color: rgb(105, 105, 105); ">77</span> <span style="color: rgb(255, 68, 0); font-weight: bold; "></html></span> </div> <span style="color: #ff0000;"><a href="http://down.qiannao.com/space/file/flowerowl/-4e0a-4f20-5206-4eab/Lazy10_Toggle(2).rar/.page" target="_blank"><span style="color: #ff0000;">下载源码</span></a></span> 转载请注明:[于哲的博客][1] » [jQuery 抄袭笔记(10) : Toggle()(2)][2] [1]: http://lazynight.me [2]: http://lazynight.me/467.html </pre></span></body></span>