Footer up/down on click
I have a problem regarding my footer position on a click event. I'm
working with bootstrap css and I have a collapsible element (accordion in
bootstrap) that when collapse it has a class named
.accordion-toggle.collapsed and when not his class is .accordion-toggle.
Well, I'm trying to slidedown the footer when this element is collapsed
(because it's overwriting the footer) and my code is:
<script>
$(function() {
var collapsed = $('.accordion-toggle.collapsed');
$('#links').click(function(){
if (collapsed)
{
$(".footer").css({'margin-top':'320px'});
}else{
$(".footer").css({'margin-top':'150px'});
}
});
});
</script>
Well the problem is that when I click on the collapsible element the
footer slidedown, but when I click again (and his class change to
(accordion-toggle) it doesn't return to his original position that is:
150px margin top.
Thanks for the help!!!
No comments:
Post a Comment