Merge pull request #6224 from bugron/fix/auto-scroll_hotfix
Fix incorrect auto-scrolling logicpull/6211/head
commit
95cd835114
|
@ -267,9 +267,11 @@ $(document).ready(function() {
|
|||
var lastChallenge = $('.sr-only').filter(function() {
|
||||
return $(this).text() === ' Complete';
|
||||
});
|
||||
lastChallenge = lastChallenge[lastChallenge.length - 1];
|
||||
var scrollTo = $(lastChallenge).offset().top - 250;
|
||||
$('html, body').scrollTop(scrollTo);
|
||||
if (lastChallenge.length) {
|
||||
lastChallenge = lastChallenge[lastChallenge.length - 1];
|
||||
var scrollTo = $(lastChallenge).offset().top - 250;
|
||||
$('html, body').scrollTop(scrollTo);
|
||||
}
|
||||
}
|
||||
|
||||
// map
|
||||
|
|
Loading…
Reference in New Issue