U
U
Uncle Deacon2017-08-03 14:07:20
Angular
Uncle Deacon, 2017-08-03 14:07:20

How to add a class to a block when hovering over another?

How to implement a hover of one block through a bunch of ng-mouseover and ng-class and assign a class to another?
I put ng-mouseover in block 1 and got stuck.
Here is an example.

<div ng-mouseover = 'inHover()' class='block1'>
<!--Какой-то контент-->
</div>
<div class='block2'>
<!--Какой-то контент-->
</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nicholas, 2017-08-03
@healqq

<div ng-mouseover = 'isHovered = true' class='block1'>
<!--Какой-то контент-->
</div>
<div class='block2' ng-class='{"hovered": isHovered}'>
<!--Какой-то контент-->
</div>

In a simple case - just like this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question