I have implemented a Cookie bar that is fixed at the top of my website. When the Close icon is clicked, the bar fades away.
Due to the positioning of the div, I am also pushing down my .nav
element by 64px.
Inquiry: Is it feasible for the margin-top
on my .nav
to gradually reduce to 0
when the Close
icon is clicked, with a similar animation speed? I am unsure how to achieve this.
Here is the link to my Demo: http://jsfiddle.net/ox19egn4/
Also, what would be the optimal way to permanently set my .nav
to margin-top:0px
after the user has viewed the Cookie bar notice?
Should I simply set it to 0 in my CSS but temporarily set it to 64px in JS?