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?
Asked
Active
Viewed 2,417 times
1

ghostCoder
- 1
- 9
- 49
- 72
-
1onscroll should just work in the newer versions of iOS. What version are you testing on? – Gerben Sep 15 '11 at 14:37
-
1Checking for event support: `typeof window.onscroll!=="undefined"` or `Object.getPrototypeOf(window).hasOwnProperty("onscroll")` – Andrew D. Sep 15 '11 at 14:44
-
also facing this issue on blackberry 5. – ghostCoder Sep 15 '11 at 17:52
-
@Andrew put that as an answer so that i can accept! :) – ghostCoder Sep 16 '11 at 13:21
2 Answers
2
Checking for event support:
typeof window.onscroll!=="undefined";
or
Object.getPrototypeOf(window).hasOwnProperty("onscroll");

Andrew D.
- 8,130
- 3
- 21
- 23
1
Try those older answers, basicly, its a problem specific to Safari on iPhone:
onscroll event not being triggered on iPad after single touch panning?