I have a javascript function to show/hide a div on click and I would like the page to scroll down to that div on show function. I have included the ScrollTop function but it
$('#output').hide();
$('#readMore').click(function(){
$('#output').show(150);
$('#readMore').hide(150);
$('html, body').scrollTop($('#output').offset().top);
return false;//return need to be placed here
});
$('#readLess').click(function(){
$('#output').hide(150);
$('#readMore').show(150);
});
return false;
at the end.$('#readMore').click(function(){
$('#output').show(150);
$('#readMore').hide(150);
$('html, body').scrollTop($('#output').offset().top);
return false; // Please put the return false; at the end.
});