diff options
Diffstat (limited to 'htdocs/static')
-rw-r--r-- | htdocs/static/js/navigation.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/htdocs/static/js/navigation.js b/htdocs/static/js/navigation.js index 689eb30..ce81ac6 100644 --- a/htdocs/static/js/navigation.js +++ b/htdocs/static/js/navigation.js @@ -15,7 +15,10 @@ $(window).keydown(function(e) { liSelected = li.eq(0).addClass('selected'); } - $('html').animate({scrollTop: liSelected.offset().top - 20}, 500); + if (liSelected) { + $('html').animate({scrollTop: liSelected.offset().top - 20}, 500); + } + return false; } @@ -33,7 +36,10 @@ $(window).keydown(function(e) { liSelected = li.last().addClass('selected'); } - $('html').animate({scrollTop: liSelected.offset().top - 20}, 500); + if (liSelected) { + $('html').animate({scrollTop: liSelected.offset().top - 20}, 500); + } + return false; } |