Open sDaniel opened 10 years ago
Hi, @sDaniel I've forked TipTip to maintain it and use in all web projects of my community. Please clone your pull request to: https://github.com/Software-js/TipTip Thanks!
Merge in: https://github.com/ScreensOS/TipTip/pull/11.
When using jquery.tiptip on SVG elements in Chrome, the tooltip appears in the top-left corner of the element instead of in the middle. In Firefox, the tooltip appears at the top of the page, nowhere near the element in question. This is caused because the jQuery method outerWidth() doesn't work with SVG. This patch uses getBoundingClientRect instead. Couldn't find any issues with normal links with a quick test.
'Some more infos on getBoundingClientRect' Browser support: https://developer.mozilla.org/en-US/docs/Web/API/Element.getBoundingClientRect getBoundingClientRect is Awesome: http://ejohn.org/blog/getboundingclientrect-is-awesome/