I fake a fixed position for a footer on a mobile site for mobile browsers that do not support a fixed position. (iOS to iOS 5, Andriod to 2.2, etc.)
Here is the jQuery code I'm using that works well and does what I want:
function changeFooterPosition() {
$('.not-fixed').css('top', window.innerHeight + window.scrollY - 56 + "px");
}
$(document).bind('scroll', function() {
changeFooterPosition();
});
So it works.
My question is that I want to add a little delay to it, and the footer will disappear, and not just click quickly after every small scroll. I looked around and found the following methods that I could use, but I'm not sure if they are correct or where to add them in js above.
.delay(1000).fadeTo('slow', 1)
I know that this functionality exists in jQuery Mobile, but I do not want to use all of jQuery Mobile for this little thing.
Thanks in advance.