-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmouseOverTesting.html
49 lines (42 loc) · 1.69 KB
/
mouseOverTesting.html
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
<html>
<head>
<title>
Mouse Over add Panel Class foundation css
</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.3/css/foundation.css">
</head>
<body ng-app="myApp">
<panel-cntrl></panel-cntrl>
<panel-cntrl mystyle="button"></panel-cntrl>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.2/angular.min.js"></script>
<script>
var app=angular.module('myApp',[]);
app.directive('panelCntrl',function(){
return{
restrict:'E',
templateUrl:'partial/panel.html',
replace:true, //If you don't write replace true, template is added //to panel-cntrl
transclude:true,//allows you to add text
link:function(scope,element,attrs)
{
//jquery type
element.bind('mouseenter',function(){
console.log("Entering");
element.addClass("panel");
element.addClass("callout");
element.addClass("radius");
element.addClass(attrs.mystyle)
//panel callout radius
}),
element.bind('mouseleave',function(){
console.log("Leaving");
element.removeClass("panel");
element.removeClass("callout");
element.removeClass("radius");
})
}
}
})
</script>
</body>
</html>