Javascript differences between window properties

Could someone please tell me the difference between these?
window.screenY and window.screenTop
as well as
window.screenX and window.screenLeft

6 thoughts on “Javascript differences between window properties”

  1. window.screenY and window.screenTop both return the same result

    window.screenX and window.screenLeft both return the same result

    But IE <= 8 doesnt support window.screenY and window.screenX.

    Firefox < 64 doesnt support window.screenTop and window.screenLeft.

    Use conditionally for browser compatibility like this

    var winTop = window.screenTop ? window.screenTop : window.screenY;
    var winLeft = window.screenLeft ? window.screenLeft : window.screenX;
    
    Reply

Leave a Comment