1

I have a tootip div in my component. I need to change the position of the tooltip according to the hovered element. How can I do it without using jquery?

1 Answer 1

1

Use the native javascript for that. The following methods are useful while positioning an element:

// First get the element
var e = document.getElementById("you-element-id");
  • e.position
  • e.style.top / e.style.bottom
  • e.style.left / e.style.right
  • e.style.clientX / e.style.clientY

And try to search for some DOM positioning tutorials on the web.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .