Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AngularJS: show hide elements based on mouse events

Here is an example - http://plnkr.co/edit/iwvjJcUurUW2AvkDArfz?p=preview

I would like the delete button to show up only when mouse hovers on the row and perform some function delete(name), by passing the name

How can I achieve this?

P.S I am new to Angular world

like image 905
daydreamer Avatar asked Feb 11 '26 13:02

daydreamer


1 Answers

This can be quickly solved with CSS, no need to bring JS or Angular. Just using basic CSS would be in my opinion better solution. Add the following to your stylesheet:

 <style>
   tr i.icon-minus-sign { display: none; }
   tr:hover i.icon-minus-sign { display: block; };
 </style>
like image 83
Andre Goncalves Avatar answered Feb 13 '26 19:02

Andre Goncalves



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!