ghostCoder
ghostCoder

Reputation: 7655

Detecting if onscroll events working / supported in browser

Is there a way to find out if javascript onscroll event is supported in a browser? Because i am working on a WebApp for android and iphones, and the onscroll event is working for android but not for iphone.

So is there any way in javascript by which i can detect if its supported in that browser?

Upvotes: 1

Views: 2451

Answers (2)

Andrew D.
Andrew D.

Reputation: 8230

Checking for event support:

typeof window.onscroll!=="undefined";

or

Object.getPrototypeOf(window).hasOwnProperty("onscroll");

Upvotes: 2

c69
c69

Reputation: 21507

Try those older answers, basicly, its a problem specific to Safari on iPhone:

onscroll event not being triggered on iPad after single touch panning?

javascript scroll event for iPhone/iPad?

Upvotes: 1

Related Questions