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.
スクロール時に scrollTop 値を取得しようとしています。つまり、ページ内の特定のポイントでのスクロールバーの位置です。
なぜこれが機能しないのですか?
$(document).scroll(function(){ alert($(document).scrollTop()); });
に包まれています$(document).ready(...
$(document).ready(...
スクロールバーを変更したときにのみトリガーされます。
http://jsfiddle.net/UtL2N/
Same code as OP