]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
No Scroll Animation when scroll_speed = 0 5997/head
authorPaul <paul.fletcher@blackboard.com>
Fri, 31 Oct 2014 19:16:46 +0000 (12:16 -0700)
committerPaul <paul.fletcher@blackboard.com>
Fri, 31 Oct 2014 19:16:46 +0000 (12:16 -0700)
While implementing Joyride on our site we noticed when setting scroll_speed to 0 per your documentation, Joyride would still scroll, but do it instantly. This small adjustment fixed the issue for us.

js/foundation/foundation.joyride.js

index a67505d38f0c94d70db11dbb2099fd09cce3652b..ebb83dbccb7fe6accb1315392533a38449d7b90b 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 (this.settings.scroll_speed !== 0 && tipOffset != 0) {
         $('html, body').stop().animate({
           scrollTop: tipOffset
         }, this.settings.scroll_speed, 'swing');