Skip to content

Commit

Permalink
Merge pull request #10729 from DanielRuf/patch-on-load
Browse files Browse the repository at this point in the history
use on() to listen for the load event
  • Loading branch information
ncoden authored Dec 24, 2017
2 parents 04a58d2 + de54ab2 commit 7839710
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/foundation.accordion.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class Accordion extends Plugin {
//roll up a little to show the titles
if (this.options.deepLinkSmudge) {
var _this = this;
$(window).load(function() {
$(window).on('load', function() {
var offset = _this.$element.offset();
$('html, body').animate({ scrollTop: offset.top }, _this.options.deepLinkSmudgeDelay);
});
Expand Down
2 changes: 1 addition & 1 deletion js/foundation.tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Tabs extends Plugin {
}

if(isActive && _this.options.autoFocus){
$(window).load(function() {
$(window).on('load', function() {
$('html, body').animate({ scrollTop: $elem.offset().top }, _this.options.deepLinkSmudgeDelay, () => {
$link.focus();
});
Expand Down

0 comments on commit 7839710

Please sign in to comment.