Auto-scroll the map to the last completed challenge
This commit is contained in:
@ -263,6 +263,15 @@ $(document).ready(function() {
|
|||||||
window.location.href = link;
|
window.location.href = link;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if ($('.sr-only').length) {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
// map
|
// map
|
||||||
$('#nav-map-btn').on('click', () => {
|
$('#nav-map-btn').on('click', () => {
|
||||||
if (!main.isMapAsideLoad) {
|
if (!main.isMapAsideLoad) {
|
||||||
|
Reference in New Issue
Block a user