-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathangular.js
More file actions
50 lines (47 loc) · 1.75 KB
/
angular.js
File metadata and controls
50 lines (47 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
var app = angular.module('app', []);
app.controller('lighbox', ['$scope', function($scope){
$scope.groups = {
1:{
thumb: 'http://www.altiusdirectory.com/Travel/images/McKinley%20Mountain%20Image.jpg',
image: 'http://www.altiusdirectory.com/Travel/images/McKinley%20Mountain%20Image.jpg',
title: 'This is a dummy title for pic 1',
description:'this is where the description goes'
},
2:{
thumb: 'https://lh4.ggpht.com/zQIXMNP87brRkMSRRiALQkgF-JRQeBW5vMgqwUt3xMwKw3yeZeZyH1GU6lzXNbDBuRM=w300',
image: 'https://lh4.ggpht.com/zQIXMNP87brRkMSRRiALQkgF-JRQeBW5vMgqwUt3xMwKw3yeZeZyH1GU6lzXNbDBuRM=w300',
title: 'This is a dummy title for pic 2',
description:'this is where the description for pic 2 goes '
},
3:{
thumb: 'http://ecx.images-amazon.com/images/I/81UUXP-xN4L._SL500_AA300_.png',
image: 'http://ecx.images-amazon.com/images/I/81UUXP-xN4L._SL500_AA300_.png',
title: 'This is a dummy title for pic 2',
description:'this is where the description for pic 2 goes '
}
};
}])
app.directive('lightbox', function() {
return {
restrict: 'E',
scope:false,
controller:function($scope){
},
link:function(scope, element, attrs){
scope.showLight = false;
scope.showpopup = function(imagenew){
scope.showlight = 'show';
scope.pop = scope.groups[imagenew].image;
}
scope.removelightbox = function(){
scope.showlight = 'FALSE';
}
scope.nextpopup = function(nextimage){
scope.showlight = 'show';
console.log(scope.groups);
scope.pop = nextimage;
}
},
templateUrl:"lightbox.html"
};
});