我想確定一個特定的DIV總是從底部20px和從右邊20px的最佳方式,即使用戶滾動。固定應該做的伎倆jQuery:在滾動上,DIV總是在任何可見的底部右邊
<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"});
});
那麼你的代碼有什麼問題?你告訴我們你想要達到的目標,但不是目前正在發生的事情 –