Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Trouble with Onclick

edited August 15 in Tipped

This almost works like I want it. I would like for an element where the else statement of the onclick is met to display a tooltip above it, and I do not want this tooltip to show otherwise which I can't figure out how to hide once the else has been met the first time. The other problem I run into is when I do the click which is part of the if statement I have to do it twice before the tooltip will show. That being said I have tried to display it normally but it still requires a click, then required me to move the mouse out of the element and back in. How do I get it to work on the first click and "destroy" the tooltip once it has been closed or on mouse out? Thank you in advance for any replies.

else {

            Tipped.create(event.target, "Tooltip Message", {
              skin: 'light',
              position: 'topleft',
              behavior: 'show',
              behavior: 'mouse',
              hideOnClickOutside: true,
              showOn: 'click',
              showDelay: 0

              });
      }

Comments

  • You shouldn’t create tooltips in mouse events, create them upfront and if all you want is to control them with custom events create them with showOn and hideOn set to false. That way you can control their display with the API using Tipped.show/hide()

Sign In or Register to comment.