{"id":1125,"date":"2012-01-20T06:27:17","date_gmt":"2012-01-20T06:27:17","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=1125"},"modified":"2012-01-20T06:27:17","modified_gmt":"2012-01-20T06:27:17","slug":"dynamic-positioning-of-the-jquery-tooltip-object","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2012\/01\/20\/dynamic-positioning-of-the-jquery-tooltip-object\/","title":{"rendered":"Dynamic positioning of the jquery tooltip object"},"content":{"rendered":"<p>We are using dynamic plugin which repositions our tooltips so that it is always visible on the viewport.<\/p>\n<p>If there is no room on the top edge then the tooltip is shown on the bottom edge. The same happens on every edge of the tooltip: top, bottom, left and right. When there is no room then the opposite edge is used. Note that this demo is only for vertical repositioning.<\/p>\n<p>It is possible to change the style, effect and other configuration variables whenever the dynamic repositioning occurs.<\/p>\n<p>We are using the offset option to position the tooltip a little higher by default. When using the dynamic effect this value is inverted. Higher means lower and further right means further left.<\/p>\n<h3>JavaScript coding<\/h3>\n<p>After initializing the tooltip we will chain our dynamic()plugin. We have used the bottom parameter to alter the tooltip configuration for the bottom edge. Every <a href=\"http:\/\/flowplayer.org\/tools\/tooltip\/index.html#configuration\">configuration option<\/a> can be used to alter the tooltip&#8217;s behaviour.<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<\/p>\n<p>jQuery(function() {<\/p>\n<p>$(&#8220;.tooltip_anchor&#8221;).tooltip ({<\/p>\n<p>offset : [10,2],<br \/>\neffect : &#8216;slide&#8217;,<br \/>\npredelay: &#8217;10&#8217;<br \/>\n\/\/ add dynamic plugin with optional configuration for bottom edge<br \/>\n}).dynamic({ bottom: { direction: &#8216;down&#8217;, bounce: true } });<\/p>\n<p>});<\/p>\n<p>&lt;\/script&gt;<\/p>\n<p>Note : the dynamic plugin and the slide effect are not included in the standard jQuery Tools distribution. You must download a <a href=\"http:\/\/flowplayer.org\/tools\/download\/index.html#combine\">custom combination<\/a> to include those effects.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>We are using dynamic plugin which repositions our tooltips so that it is always visible on the viewport. If there is no room on the <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2012\/01\/20\/dynamic-positioning-of-the-jquery-tooltip-object\/\" title=\"Dynamic positioning of the jquery tooltip object\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,14],"tags":[],"class_list":["post-1125","post","type-post","status-publish","format-standard","hentry","category-javascript","category-web-designing"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/1125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=1125"}],"version-history":[{"count":7,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/1125\/revisions"}],"predecessor-version":[{"id":1132,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/1125\/revisions\/1132"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=1125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=1125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=1125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}