NNKL.COM
welcome to my space
X
Search:  
 HOME   Compatibility helper for window.screenX vs window.screenLeft?
Compatibility helper for window.screenX vs window.screenLeft?
Published by: cfz 2010-03-12
Welcome to:nnkl.com

  • I don't know if this is the right place to post this, but I noticed there is no compatibility helper in Ext.lib.Dom for window.screenX/window.screenY vs window.screenLeft/window.screenTop

    I've only tried it in IE6/7 and FF2, but according to the 5th ed of the JavaScript rhino book, it says:

    IE, Safari, and Opera support screenLeft and screenTop, while Firefox and Safari support screenX and screenY

    I see I could just go:
    x = window.screenLeft window.screenX

    or something, but having a helper would save people (me) from having to hunt around and figure out what exactly is going on.

    /util/trunk/doh/robot/DOHRobot.java â “ dojo â “ Trac::
    46, // compatibility. 47, private static HashMap charMap = null; .. 317, // not screenX/Y of the window; really screenLeft/Top in IE, but not all. 318, // browsers have this Note: See TracBrowser for help on using the browser.
    http://bugs.dojotoolkit.org/browser/util/trunk/doh/robot/DOHRobot.java?rev=20705
    HOME
    What do you think?


  • Fair enough :">. I thought there was a slight chance of appropriateness because it was more a suggestion for enhancement rather than a request for help.

    I'm pretty sure there's nothing in Ext.Element that will get you the window position relative to the screen. I grepped for screenX and screenLeft in all of ext but there were none to be found.

    For anyone who sees this who is thinking about using window.screenX/window.screenLeft to position a popup, just know you have to check both properties.
    JavaScript::
    File Format: PDF/Adobe Acrobatwiederum, wie beispielsweise die Objekte window, document oder location, .. userAgent enthält die Zeichenkette compatible (typisch für Internet Explorer). screenX numerisch NN4: Abstand vom linken Bildschirmrand in _Pixeln screenLeft. JS 1.2 x-Koordinate der linken oberen Ecke des Fensters,
    http://digilib.happy-security.de/files/JavaScript-komplett.pdf
    HOME
    JavaScript Programmer's Reference::
    May 25, 2009 Browser version compatibility Browser upgrades are not always screenX The X coordinate of the window within the screen display.
    http://www.real-world-systems.com/docs/javascript.html
    HOME

    Also note the Y value in FF is the top of the window, whereas in IE the Y value is the top of the viewport.

    My code is

    var top = window.screenTop != undefined ? window.screenTop : window.screenY;
    var left = window.screenLeft != undefined ? window.screenLeft : window.screenX;


    edit: had to change the code. I'm not too good at compatibility code yet.


  • I don't know if this is the right place to post this

    yep. this is the wrong place to post this. ;)
    (see the guidelines for more info).

    i'll move this thread to the 2.x Help forum for better mileage.

    tip: you might want to check out the Ext.Element class.





  • Get Smart About Monitoring Virtual Machines
    Microsoft Gets Ex-Streamly Cozy with U.K.'s MediaWave

    You are looking at:nnkl.com's Compatibility helper for window.screenX vs window.screenLeft?, click nnkl.com to home
  • at 5 weeks pregnant what symptoms did you have
  • should i get this tattoo on my wrist
  • possible broken ankle
  • can i get the epidural right away
  • chemotherapy question what can help for bad diarrhoea caused by chemo
  • is humor a good way to cope grandpa
  • does any one have an idea for a pink ribbon cancer awareness tattoo
  • my best friend is pregnant
  • getting my first tattoo tomorrow
  • what do you think about this tattoo
  • i need to know please help
  • my best friend 039 s mom passed away from breast cancer and i was thinking about getting a tattoo any ideas
  • good tattoo idea picture included
  • breast cancer tatoo
  •  
  • i fell on my arm and now i have elbow pain when bending i can 039 t even bend myarm
  • my arm still hurts after i fell on it more than a week ago
  • why does my ankle hurt
  • non hodgkins lymphoma can be controlled for up to 20 years they say my question is grade 1 diagnosis how
  • need help with my homework on the gastrointestinal or digestive diseases disorders
  • my finger is crooked
  • is there a place in il that helps with bills etc health care while having cancer
  • what do u think of this phrase for a tattoo
  • how can i have my conditional green card be removed
  • i am pregnant …
  • how can you break your leg
  • i am getting a tatto on saturday tomorrow and i am going out to drink on the night
  • should i see a doc if i hit my head while ice skating even though there was no bleeding
  •  Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 nnkl.com        Site made:CFZ