I'm trying to customise the positioning of my tooltips, using jQuery UI Tooltip and this code:
$(".karma").tooltip({
position: {
my: "center bottom",
at: "right top"
}
});
But whatever I do to "my" and "at" nothing changes. What am I doing wrong?
Here is the link to the jQuery Tooltip API position section
$("#myElement"). tooltip();
The tooltip text is placed inside an inline element (like <span>) with class="tooltiptext" . CSS: The tooltip class use position:relative , which is needed to position the tooltip text ( position:absolute ). Note: See examples below on how to position the tooltip. The tooltiptext class holds the actual tooltip text.
There is nothing wrong with your code. However, without seeing your HTML, it is hard to say why it isn't working.
Make sure you have loaded jQueryUI script: here. Also make to wrap your code with $(document).ready()
. Let me know if you have any other questions.
DEMO: http://jsfiddle.net/dirtyd77/SLGdE/16/
If you got here because your positioning addition wasn't working (e.g. at: "right + 10"
), then the solution is to remove any spaces around the operator.
Change at: "right + 10"
to at: "right+10"
, and it should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With