I am attempting to achieve the following: When the button is clicked, the div will be displayed and you will automatically scroll to the bottom of the page. While my other attempts have been successful, this particular one does not seem to be working. Could it be due to its position at the bottom of the page?
Below is my JavaScript code:
$('#click-me').click(function(event){
event.preventDefault();
$('#target-div').show();
$('html, body').stop().animate({
scrollTop: $('#target-div').offset().top
}, 1000);
});