From 1e3ff7aac6e3012ca4328a65c3d0cc19dc222fc6 Mon Sep 17 00:00:00 2001 From: Tony Bebber Date: Thu, 12 Jun 2014 22:20:33 -0600 Subject: [PATCH] Added option to set nub offset in pixels for more control over what tooltip nub points to. --- jquery.joyride-2.1.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/jquery.joyride-2.1.js b/jquery.joyride-2.1.js index 72fb38d..0531af7 100755 --- a/jquery.joyride-2.1.js +++ b/jquery.joyride-2.1.js @@ -15,6 +15,7 @@ 'version' : '2.1', 'tipLocation' : 'bottom', // 'top' or 'bottom' in relation to parent 'nubPosition' : 'auto', // override on a per tooltip bases + 'nubOffset' : false, // specify exact offset to control exact nub position (false = get position from stylesheet (22px)) 'scroll' : true, // whether to scroll to tips 'scrollSpeed' : 300, // Page scrolling speed in milliseconds 'timer' : 0, // 0 = no timer , all other numbers = timer in milliseconds @@ -544,6 +545,12 @@ settings.$next_tip.css('visibility', 'visible'); } + if (settings.tipSettings.tipLocation === 'top' || settings.tipSettings.tipLocation === 'bottom') { + methods.nub_offset($nub, settings.tipSettings.nubOffset, 'left'); + } else { + methods.nub_offset($nub, settings.tipSettings.nubOffset, 'top'); + } + }, pos_phone : function (init) { @@ -811,6 +818,12 @@ } }, + nub_offset : function (nub, offset, pos) { + if (offset) { + nub.css(pos, offset); + } + }, + startTimer : function () { if (settings.$li.length) { settings.automate = setTimeout(function () {