mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
36 lines
1.0 KiB
HTML
36 lines
1.0 KiB
HTML
<html ng-app="ionic">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>List</title>
|
|
|
|
<!-- Sets initial viewport load and disables zooming -->
|
|
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
|
|
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
|
|
<script src="../../../../dist/js/ionic.bundle.js"></script>
|
|
</head>
|
|
<body>
|
|
<ion-toggle ng-model="shouldShowScrollView"></ion-toggle>
|
|
<ion-scroll delegate-handle="myScroll" ng-if="shouldShowScrollView">
|
|
<div ng-controller="ScrollCtrl">
|
|
<ion-list>
|
|
<ion-item ng-repeat="i in items">{{i}}</ion-item>
|
|
</ion-list>
|
|
</div>
|
|
</ion-scroll>
|
|
<script>
|
|
function ScrollCtrl($scope, $ionicScrollDelegate) {
|
|
var delegate = $ionicScrollDelegate.getByHandle('myScroll');
|
|
|
|
delegate.rememberScrollPosition('my-scroll-id');
|
|
delegate.scrollToRememberedPosition();
|
|
|
|
$scope.items = [];
|
|
for (var i=0; i<100; i++) {
|
|
$scope.items.push(i);
|
|
}
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|