]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Fix bug where joyride fails to scroll up for next tip 3921/head
authorGeorge <george@gsgd.co.uk>
Wed, 18 Dec 2013 16:35:41 +0000 (16:35 +0000)
committerGeorge <george@gsgd.co.uk>
Wed, 18 Dec 2013 16:35:41 +0000 (16:35 +0000)
If the next tip is higher on the page than current tip a negative tipOffset results in joyride not scrolling to show position of the next tip. This commit fixes that behaviour by scrolling unless tipOffset is 0 which I assume is intended behaviour

js/foundation/foundation.joyride.js

index f7140aab9d0409906875b55a6ba3ee6846341684..a62fdde71e89236c043a83fd5866abf277496df0 100644 (file)
       window_half = $(window).height() / 2;
       tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight());
 
-      if (tipOffset > 0) {
+      if (tipOffset != 0) {
         $('html, body').animate({
           scrollTop: tipOffset
         }, this.settings.scroll_speed, 'swing');