I’m trying to determine the best way to make sure that a specific DIV is always 20px from the bottom and 20px from the right, even once a user scrolls.
<body>
<div id="wrap">
<p>Some content</p>
</div>
<div class="social-badges"><!-- this is the box that will always be at the bottom right --></div>
</body>
$(window).scroll(function() {
console.log('scrolling');
$(".tba-social-slider").css({"position" : "absolute", "bottom" : "20px", "right" : "20px"});
});
CSS position fixed should do the trick:
No Javascript needed IMO.