Having an issue with my footer position on a click event. Using bootstrap css and working with a collapsible element (accordion in bootstrap). When collapsed, it has a class named .accordion-toggle.collapsed, and when expanded, the class is .accordion-toggle.
Trying to slide down the footer when the element is collapsed as it's overlapping the footer. The code being used:
<script>
$(function() {
var collapsed = $('.accordion-toggle.collapsed');
$('#links').click(function(){
if (collapsed){
$(".footer").css({'margin-top':'320px'});
}else{
$(".footer").css({'margin-top':'150px'});
}
});
});
</script>
However, the issue arises when clicking on the collapsible element - the footer slides down, but clicking again when it's not collapsed (class changes to accordion-toggle) doesn't return the footer to its original position of 150px margin top.
Appreciate any help or advice!