MahdiF / loud-links

:sound: A simple tiny Javascript library to add interaction sounds to your website.
https://mahdif.github.io/loud-links/
MIT License
725 stars 60 forks source link

fix bubbling issue with mouseover event #9

Closed gibatronic closed 8 years ago

gibatronic commented 8 years ago

Hi there Mahdi!

This pull request aims to fix the following issue: https://jsfiddle.net/bhzyac58/1/

When you move the cursor between the blue border and the image in the link, the sound is fired multiple times, because that's the nature of the mouseover event, it bubbles.

So this pull request replaces the mouseover and mouseout events in favor of mouseenter and mouseleave ones.

Hope it helps!

MahdiF commented 8 years ago

Thank you @gibatronic for reporting the issue and fixing it. :+1: