谁能帮我看一下,怎么解决,怎么实现分页效果呢?现在做了一半,
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{padding: 0;margin: 0;}
ul li{width: 30px;height: 30px;line-height: 30px;text-align: center;border: 1px solid #ccc;float: left;
margin-right: 0.5em;list-style: none;cursor: pointer;}
ul li:first-child,li:last-child{border: none;padding-right: .5em;}
.active{background: #555;color: #fff;}
li:first-child::before{content: "\00AB";margin-right: .3em;}
li:last-child::after{content: "\00BB";margin-left: .3em;}
</style>
</head>
<body>
<ul>
<li>pre</li>
<li class="active">1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>next</li>
</ul>
<script type="text/javascript">
window.onload=function(){
var li=document.getElementsByTagName('li');
var before=document.getElementsByClassName('active');
for(var i=1;i<li.length-1;i++){
li[i].onclick=function(){
this.className='active';
// before.className='';
}
}
}
</script>
</body>
</html>