Question: I'm trying to determine how many pixels down I've scrolled using `window.scrollY`. But this isn't supported in IE8. What is the safe, cross-browser alternative?

Answer: 
The cross-browser compatible version for `window.scrollY` is `document.documentElement.scrollTop`. Please see the 'Notes' section of this piece of [**Mozilla documentation**](https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY?redirectlocale=en-US&redirectslug=DOM/window.scrollY) for a full, detailed workaround in IE8 and before.

[**As mentioned here**](http://help.dottoro.com/ljnvjiow.php), `pageYOffset` is another alternative to window.scrollY (note though that this is only IE9+ compatible). 

In regard to the link above, check **Example 4** for a fully compatible way to get the scroll position (it even accounts for zoom as @adeneo mentioned!) using `document.documentElement.scrollTop` and `document.documentElement.scrollLeft`. 

[**Here, try out the example for yourself!**](http://help.dottoro.com/external/examples/ljnvjiow/scrollTop_4.htm)
window.scrollY & window.scrollX works fine in all modern browers like (Chrome, FireFox & Safari) but does not work in IE so to fix the use window.pageXOffset or window.pageYOffset.

Here is a sample code I wrote to fix ie issue so that the programmatic scrolling works in all browsers including IE

```
if((window.scrollY || window.pageYOffset) >= 1100){
   //alert('Switch to land');
    $('#landTrst').trigger('click'); // your action goes here
}else if ((window.scrollY || window.pageYOffset) <= 900) {   
    //alert('Switch to Refernce Letter');
     $('#resLet').trigger('click'); // your action goes here
}                            

```