PDA

View Full Version : Is there a function to get the browsers position on the screen?



Elijah
19 May 2010, 7:45 AM
Was looking to see if there was already a cross browser function that will give me the position of the actual browser on the screen or do I have to put one together?

If there is one in the API please post a link or tell me what section.

Thanks

CrazyEnigma
19 May 2010, 1:40 PM
Well, nothing that I know of in EXT JS. You might think EXT JS could do this for you, but I did a little search online, and here is what you can do (http://www.quirksmode.org/dom/w3c_cssom.html).

So the only think I suggest you do, is use the Ext singleton to determine the browser for you, and do what is appropriate.

Elijah
19 May 2010, 5:29 PM
Hey Crazy. Thanks for the link. I was actually trying to use that kind of code earlier on the offline system (browser ie) was going nuts wondering what was wrong. Turns out once again cant count on IE.
It does works for FireFox. I'd rather support FF any day over IE.

http://www.quirksmode.org/dom/tests/windowview.html#screenX%20and%20screenY
window.screenX
window.screenY