Ask questions and get good answers on jQuery

Inserting the doctype

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

the $("body").scrollTop() returns 0 instead of the correct value.

Any suggestion?

asked Oct 23 '09 at 08:49

Bikrob's gravatar image

Bikrob
1112

edited Oct 26 '09 at 19:57

Pietro%20Polsinelli's gravatar image

Pietro Polsinelli ♦♦
407


You should get the "document" scrollTop():

$(document).scrollTop()

answered Oct 23 '09 at 17:15

Matteo%20Bicocchi's gravatar image

Matteo Bicocchi ♦♦
1776129

edited Oct 23 '09 at 20:31

Your answer
toggle preview

jQuery main site - Matteo Bicocchi