I would like to calculate a responsive margin-top for the footer of a navigation - it should always be placed 50px over the bottom. I wrote this code but it doesn't work - anybody can help me?
(function () {
$(window).resize(function () {
var navHeight = $("nav").height();
$("nav footer").css({ "margin-top": navHeight - 50 });
}).resize(); });
This is the stylesheet for the elements so far, pretty basic.
nav { position:fixed; top:0; left:0; width:320px; height:100%; padding:100px 0 0 0; }
nav footer { }
I really need this to be done with jQuery - no CSS solutions. Sorry!