感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.min.js"></script>
<div ng-app="lyweb" ng-controller="ctrlPige" >
<div class="pagination">页数:{{nowNum}}/{{allNum}}</div>
<div class="pagination">首页</div>
<div id="pigeList">
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
</ul>
</div>
<div class="pagination">末页</div>
<div class="pagination" ng-click="pigePrevious()">上一页</div>
<div class="pagination" ng-click="pigeNext()">下一页</div>
<div ng-include="myhtml"></div>
xxxxxxxxxx
var app = angular.module('lyweb',[]);
app.controller('ctrlPige',['$scope',function($scope){
$scope.nowNum = 0;
$scope.allNum= 30;
$scope.pige=1;
$scope.pigePrevious=function(){
$scope.pige-=1;
if($scope.pige==0)$scope.pige=0;
$scope.myhtml='t'+$scope.pige+'.html';
};
$scope.pigeNext=function(){
$scope.pige+=1;
if($scope.pige==30)$scope.pige=30;
}]);
.cl{
clear: left;
}
.pagination{
float:left;
border:1px solid #ccc;
display:inline-block;
#pigeList{
#pigeList>ul{
margin:0;
padding:0;
#pigeList>ul>li{
list-style: none;
#pigeList>ul>li:nth-child(1),
#pigeList>ul>li:nth-child(2),
#pigeList>ul>li:nth-child(3),
#pigeList>ul>li:nth-child(4),
#pigeList>ul>li:nth-child(5){
display:none;