<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="../../js/ionic/css/ionic.css" />
<script type="text/javascript" src="../../js/ionic/js/ionic.bundle.min.js"></script>
<script>
var app = angular.module("myApp", ["ionic"]);
app.controller("myCtrl", function($scope, $ionicScrollDelegate) {
$scope.scrollTop = function() {
$ionicScrollDelegate.scrollTop();
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<ion-header-bar class="bar-positive">
<h3 class="title">ionic_content</h3>
</ion-header-bar>
<ion-content padding="true">
haha
<!--<pre>
这是顶部
a
<button ng-click="scrollTop()">回到顶部</button>
</pre>-->
<ion-scroll zooming="true" scrollbar-x="true" direction="xy" style="width: 100%; height: 1200px">
<div style="width: 5000px; height: 5000px; background: url('http://www.runoob.com/try/demo_source/Europe_geological_map-en.jpg') repeat"></div>
</ion-scroll>
</ion-content>
<ion-footer-bar class="bar-assertive">
<h3 class="title">底部</h3>
</ion-footer-bar>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="../../js/ionic/css/ionic.css" />
<script type="text/javascript" src="../../js/ionic/js/ionic.bundle.min.js"></script>
<script>
var app = angular.module("myApp", ["ionic"]);
app.controller("myCtrl", function($scope, $ionicScrollDelegate) {
$scope.scrollTop = function() {
$ionicScrollDelegate.scrollTop();
}
});
</script>
</head>
<body ng-app="myApp" ng-controller="myCtrl">
<ion-header-bar class="bar-positive">
<h3 class="title">ionic_content</h3>
</ion-header-bar>
<ion-content padding="true">
haha
<!--<pre>
这是顶部
a
<button ng-click="scrollTop()">回到顶部</button>
</pre>-->
<ion-scroll zooming="true" scrollbar-x="true" direction="xy" style="width: 100%; height: 1200px">
<div style="width: 5000px; height: 5000px; background: url('http://www.runoob.com/try/demo_source/Europe_geological_map-en.jpg') repeat"></div>
</ion-scroll>
</ion-content>
<ion-footer-bar class="bar-assertive">
<h3 class="title">底部</h3>
</ion-footer-bar>
</body>
</html>