I've successfully implemented a show and hide function in Angular for a new project. Currently, when a user hovers over a tile, the corresponding class is added and removed as intended.
<article class="col-sm-6" ng-mouseenter="showHiddenTile()" ng-mouseleave="hideHiddenTile()">
<div class="grid-block--img">
<img src="/assets/homepage/home-tile5.png">
<div class="grid-headings">
<h2>a new<br/>home for<br/>whiskey</h2>
<p><span class="heading--bold">WORK.</b><span> Food and Beverage Design<
</div>
<div class="grid-block-hidden" ng-class="{isVisble: tileBlock}">My overlay</div>
</div>
</article>
However, I now want to reuse this show and hide functionality multiple times across the site. Currently, hovering over one element causes the isActive class to be applied to all elements simultaneously instead of individually.
Here's the Angular code:
// SHOW AND HIDE FUNCTION
$scope.showHiddenTile = function() {
$scope.tileBlock = true;
}
$scope.hideHiddenTile = function() {
$scope.tileBlock = false;
}
How can I target the isVisble class individually without affecting others?