@foreach (var item in RootOfJson.results)
{
<div class="card" @onmouseout="@OnMouseOut" @onmouseover="@OnMouseOver">
<img class="@Imgdisplay" <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aedddccd93eec7dacbc380c7c3cfc9cb">[email protected]</a>_url alt="...">
</div>
}
@code {
bool _IsHovering = false;
[Parameter]
public string Imgdisplay { get; set; }
protected void OnMouseOver(MouseEventArgs mouseEvent)
{
if (!_IsHovering)
{
_IsHovering = true;
Imgdisplay = "d-none";
StateHasChanged();
}
}
protected void OnMouseOut(MouseEventArgs mouseEvent)
{
Imgdisplay = String.Empty;
_IsHovering = false;
StateHasChanged();
}
The code snippet above is for changing the css class for all divs. However, I am looking for assistance to modify it so that the class is changed to d-none only on the specific div where the mouse event occurs.