Skip to content

Commit 761319c

Browse files
committed
Merge pull request cferdinandi#237 from cferdinandi/development
v9.1.1
2 parents 55dcd6c + e5be456 commit 761319c

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

dist/js/smooth-scroll.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v9.1.0: Animate scrolling to anchor links
2+
* smooth-scroll v9.1.1: Animate scrolling to anchor links
33
* (c) 2016 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/smooth-scroll
@@ -343,24 +343,24 @@
343343

344344
// Options and overrides
345345
var overrides = getDataOptions( toggle ? toggle.getAttribute('data-options') : null );
346-
var settings = extend( settings || defaults, options || {}, overrides ); // Merge user options with defaults
346+
var animateSettings = extend( settings || defaults, options || {}, overrides ); // Merge user options with defaults
347347

348348
// Selectors and variables
349349
var isNum = Object.prototype.toString.call( anchor ) === '[object Number]' ? true : false;
350350
var anchorElem = isNum ? null : ( anchor === '#' ? root.document.documentElement : root.document.querySelector(anchor) );
351351
if ( !isNum && !anchorElem ) return;
352352
var startLocation = root.pageYOffset; // Current location on the page
353-
if ( !fixedHeader ) { fixedHeader = root.document.querySelector( settings.selectorHeader ); } // Get the fixed header if not already set
353+
if ( !fixedHeader ) { fixedHeader = root.document.querySelector( animateSettings.selectorHeader ); } // Get the fixed header if not already set
354354
if ( !headerHeight ) { headerHeight = getHeaderHeight( fixedHeader ); } // Get the height of a fixed header if one exists and not already set
355-
var endLocation = isNum ? anchor : getEndLocation( anchorElem, headerHeight, parseInt(settings.offset, 10) ); // Location to scroll to
355+
var endLocation = isNum ? anchor : getEndLocation( anchorElem, headerHeight, parseInt(animateSettings.offset, 10) ); // Location to scroll to
356356
var distance = endLocation - startLocation; // distance to travel
357357
var documentHeight = getDocumentHeight();
358358
var timeLapsed = 0;
359359
var percentage, position;
360360

361361
// Update URL
362362
if ( !isNum ) {
363-
updateUrl(anchor, settings.updateURL);
363+
updateUrl(anchor, animateSettings.updateURL);
364364
}
365365

366366
/**
@@ -377,7 +377,7 @@
377377
if ( !isNum ) {
378378
anchorElem.focus();
379379
}
380-
settings.callback( anchor, toggle ); // Run callbacks after animation complete
380+
animateSettings.callback( anchor, toggle ); // Run callbacks after animation complete
381381
}
382382
};
383383

@@ -387,9 +387,9 @@
387387
*/
388388
var loopAnimateScroll = function () {
389389
timeLapsed += 16;
390-
percentage = ( timeLapsed / parseInt(settings.speed, 10) );
390+
percentage = ( timeLapsed / parseInt(animateSettings.speed, 10) );
391391
percentage = ( percentage > 1 ) ? 1 : percentage;
392-
position = startLocation + ( distance * easingPattern(settings.easing, percentage) );
392+
position = startLocation + ( distance * easingPattern(animateSettings.easing, percentage) );
393393
root.scrollTo( 0, Math.floor(position) );
394394
stopAnimateScroll(position, endLocation, animationInterval);
395395
};

dist/js/smooth-scroll.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/dist/js/smooth-scroll.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* smooth-scroll v9.1.0: Animate scrolling to anchor links
2+
* smooth-scroll v9.1.1: Animate scrolling to anchor links
33
* (c) 2016 Chris Ferdinandi
44
* MIT License
55
* http://github.com/cferdinandi/smooth-scroll
@@ -343,24 +343,24 @@
343343

344344
// Options and overrides
345345
var overrides = getDataOptions( toggle ? toggle.getAttribute('data-options') : null );
346-
var settings = extend( settings || defaults, options || {}, overrides ); // Merge user options with defaults
346+
var animateSettings = extend( settings || defaults, options || {}, overrides ); // Merge user options with defaults
347347

348348
// Selectors and variables
349349
var isNum = Object.prototype.toString.call( anchor ) === '[object Number]' ? true : false;
350350
var anchorElem = isNum ? null : ( anchor === '#' ? root.document.documentElement : root.document.querySelector(anchor) );
351351
if ( !isNum && !anchorElem ) return;
352352
var startLocation = root.pageYOffset; // Current location on the page
353-
if ( !fixedHeader ) { fixedHeader = root.document.querySelector( settings.selectorHeader ); } // Get the fixed header if not already set
353+
if ( !fixedHeader ) { fixedHeader = root.document.querySelector( animateSettings.selectorHeader ); } // Get the fixed header if not already set
354354
if ( !headerHeight ) { headerHeight = getHeaderHeight( fixedHeader ); } // Get the height of a fixed header if one exists and not already set
355-
var endLocation = isNum ? anchor : getEndLocation( anchorElem, headerHeight, parseInt(settings.offset, 10) ); // Location to scroll to
355+
var endLocation = isNum ? anchor : getEndLocation( anchorElem, headerHeight, parseInt(animateSettings.offset, 10) ); // Location to scroll to
356356
var distance = endLocation - startLocation; // distance to travel
357357
var documentHeight = getDocumentHeight();
358358
var timeLapsed = 0;
359359
var percentage, position;
360360

361361
// Update URL
362362
if ( !isNum ) {
363-
updateUrl(anchor, settings.updateURL);
363+
updateUrl(anchor, animateSettings.updateURL);
364364
}
365365

366366
/**
@@ -377,7 +377,7 @@
377377
if ( !isNum ) {
378378
anchorElem.focus();
379379
}
380-
settings.callback( anchor, toggle ); // Run callbacks after animation complete
380+
animateSettings.callback( anchor, toggle ); // Run callbacks after animation complete
381381
}
382382
};
383383

@@ -387,9 +387,9 @@
387387
*/
388388
var loopAnimateScroll = function () {
389389
timeLapsed += 16;
390-
percentage = ( timeLapsed / parseInt(settings.speed, 10) );
390+
percentage = ( timeLapsed / parseInt(animateSettings.speed, 10) );
391391
percentage = ( percentage > 1 ) ? 1 : percentage;
392-
position = startLocation + ( distance * easingPattern(settings.easing, percentage) );
392+
position = startLocation + ( distance * easingPattern(animateSettings.easing, percentage) );
393393
root.scrollTo( 0, Math.floor(position) );
394394
stopAnimateScroll(position, endLocation, animationInterval);
395395
};

0 commit comments

Comments
 (0)