I have a div
<div id="slideHolder" ng-mouseenter="fadeIn()" ng-mouseleave="fadeOut()">
...
</div>
And the content in the middle fades in an out on mouseenter/leave
$scope.fadeIn = function()
{
TweenLite.to("#zoomInButton",0.3,{opacity:1});
}
$scope.fadeOut = function()
{
TweenLite.to("#zoomInButton",0.3,{opacity:0});
}
Is it possible combine those two functions into one using an if statement ? I know how I'd do it in jQuery, but not sure how to in Angular. Thanks
Edit: This is how I did it in jQuery
$("#slideHolder").hover(
function() {
$("#zoomButton").stop(true,true).fadeIn();
},
function() {
$("#zoomButton").stop(true,true).fadeOut();
}
);
Granted they are technically two function still, I was able to shorthand them into the hover method
I was able to figure this one out
<div id="slideHolder" ng-mouseenter="fade($event)" ng-mouseleave="fade($event)">
....
</div>
and in angular
$scope.fade = function(event)
{
(event.type == 'mouseover') ? TweenLite.to("#zoomInButton",0.3,{opacity:1}) : TweenLite.to("#zoomInButton",0.3,{opacity:0});
}