problems with mouse events #3078
-
Hello! I'm more or less new to JS. I want to be able to hover over a region and print the content of the region for now. I get it to work when clicking:
This does however not seem to work. I have tried "region-mouseenter" and "region-mouseleave" as eventName, but it doesent seem to get it right.
Help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This looks correct and should work. That's how it's done in this example as well: https://wavesurfer-js.org/examples/#regions.js Mouse over/leave events aren't propagated to the top-level Regions plugin events, but they are emitted as individual Region events. So you can do things like: const region = wsRegions.addRegion({ ... })
region.on('over', () => { console.log(region.content.innerHTML) }) |
Beta Was this translation helpful? Give feedback.
This looks correct and should work. That's how it's done in this example as well: https://wavesurfer-js.org/examples/#regions.js
Mouse over/leave events aren't propagated to the top-level Regions plugin events, but they are emitted as individual Region events. So you can do things like: