I have a <div> at the bottom of my webpage that is hidden when the page loads, there is a link in the visible footer that causes it to slide down to display using the jQuery slidedown() function. There is also a link to hide it again.
Link to open:
<a href="javascript:void(0)" class="cookies_open">Open</a>
An element with a link to hide inside:
<div id="hiddenbit"> <a href="javascript:void(0)" class="cookies_close">hide</a> </div>
JS:
$(document).ready(function(){ $(".cookies_close").click(function(){ $("#hiddenbit").slideUp(1000); }); $(".cookies_open").click(function(){ $("#hiddenbit").slideDown(1000); }); });
Now it all works. BUT, because the item is at the bottom of the page, I need the browser to scroll down to display it when it opens. At the moment, the scroll bar is expanding, but the page does not scroll down so that the user cannot see it.
How can i do this?
source share