12
mai

jQuery and scrollTop, how can this work for IE/Chrome/Safari and Firefox ?

Today I have to make a scrollTop for a webpage, and I use jQuery for the most part of the javascript in the website.

So, the problem is, I do $(‘body’).scrollTop(0); and this work for Safari/Chrome, but only for it. So, I looking for a solution in the Internet, and it’s a pain to find one for all. But finally I found one, やった (yatta)!

What is it ? Simply $(« html,body »).animate({scrollTop: 0},0); and it’s work.

© Copyright 2010-2012 Precea. All rights reserved. Proudly powered by Black Sakura WP.