Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (44 sloc) 1.1 KB
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Scroll Trigger</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.2/angular.js"></script>
<script src="../dist/scroll-trigger.js"></script>
<script>
angular.module('demo', ['scroll-trigger'])
.controller('TestCtrl', function($scope) {
$scope.call = function(thing) {
console.log('called with ' + thing);
};
$scope.isActive = false;
})
.run(function() {
for (var i = 0; i < 5; ++i) {
var div = document.createElement('div');
div.setAttribute('scroll-trigger', 'call(' + i + ')');
div.setAttribute('ng-controller', 'TestCtrl');
if (i % 2) {
div.setAttribute('trigger-active', 'isActive');
}
document.body.appendChild(div);
}
});
</script>
<style>
div {
width: 200px;
height: 1000px;
}
.placeholder {
background-color: #000;
}
div:nth-child(2n) {
background-color: #147;
}
</style>
</head>
<body ng-app="demo">
<div class="placeholder"></div>
</body>
</html>
You can’t perform that action at this time.