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.
javascriptを使用して、特定のdivクラスを持つ最初の可視要素に自動的にスクロールする方法はありますか?
ありがとう!
次のようなものを使用できるはずです。
$('html, body').animate({ scrollTop: $('.class:visible:first').offset().top }, 1000);
デモ: http://jsfiddle.net/Blender/xUw54/2/