<div class="codetitle"> <span><a style="CURSOR: pointer" data="47027" class="copybut" id="copybut47027" onclick="doCopy('code47027')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code47027"> <br> <br> <br><title>超简单上下翻</title> <br><script type="text/javascript" src="js/jquery.js"></script> <br> <br> <br>简单上下翻,函数 <br><script type="text/javascript"> <BR>function UpDown(What) { <BR>var aList = $("#tab a"); <BR>var oldnode = aList.get(0); <BR>/* <BR>*获取最后一个元素三种方法 <BR>*/ <BR>newnode = aList[aList.length - 1]; <BR>newnode = aList.get(aList.length - 1); <BR>newnode = $("#tab a:last"); <BR>if (What == "up") return $(oldnode).before(newnode); <BR>$(newnode).after(oldnode) <BR>} <BR></script> <br><div id="tab"> <br><a href="#"> a </a><a href="#"> b </a><a href="#"> c </a><a href="#"> d </a><a href="#"> e </a><a href="#"> f </a> </div> <br><a href="#" onclick="UpDown('up')">上一个</a> <br><a href="#" onclick="UpDown()">下一个</a> <br> <br> <br> </div>