I would like (on start of the page) having my nav on the bottom on screen. After that when we scroll the nav will be sticky to the top of the page (with waypoints) If I put my nav in relative it's working, but with fixed it's doesn't work. Sorry for my poor english, thanks.
<style>
#social-float {
position: fixed;
bottom: 0px;
width: 55px;
}
#footer { height: 235em; background: #888; }
#background {
background: url(images/background.jpg) no-repeat top center fixed;
background-size: 100% 100%;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
<link rel="stylesheet" href="css/css.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="js/waypoints.min.js"></script>
<script src="js/waypoints-sticky.min.js"></script>
<script>function checkOffset() {
var a=$(document).scrollTop()+window.innerHeight;
var b=$('#footer').offset().top;
if (a<b) {
$('#social-float').css('bottom', '10px');
} else {
$('#social-float').css('bottom', (10+(a-b))+'px');
}
}
$('.my-sticky-element').waypoint('sticky');
</script>
<div id="background" style="height:1000px">
long content sample
</div>
<div id="social-float" class="my-sticky-element">
<ul id="nav">
<li><a href="#a">One</a></li>
<li><a href="#b">two</a></li>
<li><a href="#c">three</a></li>
</ul>
</div>
<div id="footer">
footer sample
</div>