jQuery: on scroll, DIV always at the bottom right of whatever is viewable -


i'm trying determine best way make sure specific div 20px bottom , 20px right, once user scrolls.

<body> <div id="wrap"> <p>some content</p> </div> <div class="social-badges"><!-- box @ bottom right --></div> </body>  $(window).scroll(function() {         console.log('scrolling');         $(".tba-social-slider").css({"position" : "absolute", "bottom" : "20px", "right" : "20px"});     }); 

css position fixed should trick:

.tba-social-slider{   position: fixed;   bottom: 20px;   right: 20px; } 

no javascript needed imo.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -