-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcontroller.js
More file actions
38 lines (35 loc) · 1.21 KB
/
controller.js
File metadata and controls
38 lines (35 loc) · 1.21 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
function mainCtrl($scope){
$scope.hello = "hello"; //first input text
}
angular.module('myApp', [])
.directive('slider', function() {
return {
restrict:'A',
link:function(scope,element,attrs){
// undefined attrs on the element will use the jquery UI defaults
element.slider({
min: attrs.min,
max: attrs.max,
value: attrs.value,
step: attrs.step,
slide: function( event, ui ) {
if(ui.value == 3){
$(this).find('a').css('margin-left','-31%')
}else if(ui.value == 2){
$(this).find('a').css('margin-left','-15%')
}else if(ui.value == 1){
$(this).find('a').css('margin-left','0%')
}else{
$(this).find('a').css('margin-left','-15%')
}
if(event.target.id =="slider1"){
scope.hello = ui.value;
}else if(event.target.id == "slider2"){
scope.goodbye = ui.value;
}
scope.$apply();
}
});
}
};
});