Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
div があり、ブラウザーのスクロールバーが上下に移動したときにその位置を見つける必要があります。これは、この div の現在の位置を検出するのに役立ち、この div の現在の位置に応じて、その上に別の div を配置できます。
次のように位置を取得できます。
var offset = $('#element').offset(); alert(offset.top + offset.left);