mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(): reorganize source files
This commit is contained in:
35
test/html/rememberScroll.html
Normal file
35
test/html/rememberScroll.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user