Radley Sustaire
Radley Sustaire

Reputation: 3399

jQuery .scroll() events for the body/window/html/document

I need a cross-browser way of binding to the scroll event for the browser's native scrollbar.

$("html, body") seems to work for firefox, while $(window) seems to work for IE.

Is there a better way to use the correct version rather than trial and error? I also would like to detect mobile scrolling, if possible.

Upvotes: 3

Views: 11409

Answers (1)

Nicola Peluchetti
Nicola Peluchetti

Reputation: 76880

If $(window).scroll() works with IE (and it works with firefox and Chrome too) i think you should use it

Upvotes: 9

Related Questions