<nav class="cf_nav clearfix"> <ul> <li> <a href="首頁"> <div class="nav_block"> <span>首頁</span> <span class="hover">首頁</span> </div> </a> </li> <li> <a href="投稿"> <div class="nav_block"> <span>投稿</span> <span class="hover">投稿</span> </div> </a> </li> <li> <a href="私信 "> <div class="nav_block"> <span>私信 </span> <span class="hover">私信 </span> </div> </a> </li> <li> <a href="存檔"> <div class="nav_block"> <span>存檔</span> <span class="hover">存檔</span> </div> </a> </li> <li> <a href="訂閱"> <div class="nav_block"> <span>訂閱</span> <span class="hover">訂閱</span> </div> </a> </li>
如果我在限制上面的span中的字符
$("nav_block span")
它使用了下面的一個算定義jquery插件的方法
// copyright c by zhangxinxu v
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20180.html