Skip to content

problems with mouse events #3078

Answered by katspaugh
emilgraichen asked this question in Q&A
Discussion options

You must be logged in to vote

wsRegions.on('region-clicked', (region) => { console.log(region.content.innerHTML); });

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) })

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@emilgraichen
Comment options

Answer selected by emilgraichen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants