Fix incorrect auto-scrolling logic
This commit is contained in:
@ -267,9 +267,11 @@ $(document).ready(function() {
|
|||||||
var lastChallenge = $('.sr-only').filter(function() {
|
var lastChallenge = $('.sr-only').filter(function() {
|
||||||
return $(this).text() === ' Complete';
|
return $(this).text() === ' Complete';
|
||||||
});
|
});
|
||||||
lastChallenge = lastChallenge[lastChallenge.length - 1];
|
if (lastChallenge.length) {
|
||||||
var scrollTo = $(lastChallenge).offset().top - 250;
|
lastChallenge = lastChallenge[lastChallenge.length - 1];
|
||||||
$('html, body').scrollTop(scrollTo);
|
var scrollTo = $(lastChallenge).offset().top - 250;
|
||||||
|
$('html, body').scrollTop(scrollTo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// map
|
// map
|
||||||
|
Reference in New Issue
Block a user