hwo to get the container to move up when div slides down
Hi,
I'm new to jquery so please bear with me!
I'm using the below jquery to make a div slide up and down - basically when you click on an image a div containing text appears below. This works great apart from when the image is near the bottom of the screen it slides the text down but below the fold so you cannot see it without scrolling down.
Is there an easy way for when the div slides down for the whole screen/container to move up so the text is always readable on screen without having to scroll?
Thanks
$(document).ready(function() {
//Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
$('.acc_trigger:first').next().hide(); //Add "active" class to first trigger, then show/open the immediate next container
//On Click
$('.acc_trigger').click(function(){
if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
$('.acc_trigger').next().slideUp(); //Remove all "active" state and slide up the immediate next container
$(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
}
return false; //Prevent the browser jump to the link anchor
});
});