So I have this big long block of text that I am trying to hide/reveal using jquery to change the css height for the text's containing div.
<script>
$(document).ready(function() {
$('#center_slide_down_link').click(function() {
$('.center_slide_down').animate({
height: 1200
}, 1000 );
$(this).hide();
$('#center_slide_up_link').show();
});
$('#center_slide_up_link').click(function() {
$('.center_slide_down').animate({
height: 450
}, 1000 );
$(this).hide();
$('#center_slide_down_link').show();
});
});
</script>
Whenever the user tries to reveal/hide the content, the browser automatically scrolls to the top of the page. What is the best method to keep the scroll position from changing when the user clicks the reveal/hide links?