代码
<html>
<head>
<title>超简单上下翻-jquery-博客园-(4-20)</title>
<script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
<head>
<title>超简单上下翻-jquery-博客园-(4-20)</title>
<script type="text/javascript" src="js/jquery.js"></script>
</head>
<body>
<script type="text/javascript">
function UpDown(What) {
var aList = $("#tab a");
var oldnode = aList.get(0);
/*
*jquery获取最后一个元素三种方法
*/
newnode = aList[aList.length - 1];
newnode = aList.get(aList.length - 1);
newnode = $("#tab a:last");
function UpDown(What) {
var aList = $("#tab a");
var oldnode = aList.get(0);
/*
*jquery获取最后一个元素三种方法
*/
newnode = aList[aList.length - 1];
newnode = aList.get(aList.length - 1);
newnode = $("#tab a:last");
if (What == "up") return $(oldnode).before(newnode);
$(newnode).after(oldnode)
}
</script>
$(newnode).after(oldnode)
}
</script>
<div id="tab">
<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>
<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>
<a href='#' onclick="UpDown('up')">上一个4-20号</a>
<a href='#' onclick="UpDown()">下一个</a>
</body>
</html>
<a href='#' onclick="UpDown()">下一个</a>
</body>
</html>