Skip to content

Creating a plugin that supports mouse-hover actions #821

Answered by conbainbridge
chenxuh2 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

Yes, this should be doable by customizing a plugin! One way I would tackle this is:

  • Start from the html-button-response plugin as a baseline
  • Create a span tag around the text label of the buttons that sets style="visibility: hidden" and set it to have a unique ID (you could make use of the i variable in a for loop, as is used in the existing click eventListener, to iterate over each button uniquely)
  • Create a mouseover eventListener to update the style visibility to "visible"
  • If you want it to change back when not hovered, have another eventListener for mouseout

This resource may be of help as well: https://www.w3schools.com/js/js_htmldom_eventlistener.asp

Hope this helps!

Replies: 1 comment 1 reply

Comment options

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

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