Страница на Жерар Т. за свойствата, методите и събитията на прозорците

ТАЗИ СТРАНИЦА БИ ТРЯБВАЛО ДА БЪДЕ ГЛЕДАНА САМО С Internet Explorer 6. Можете да влачите, местите и променяте размера на 2-те основи кутии.

My most appreciative thanks goes to Stanimir S. :) for giving his time and volunteering his efforts to translate this page in Bulgarian.

Координатни линии
Данни за екрана и прозорецаЦъкнете за да фиксирате елемента във видимата област

Хоризонтална разделителна способност на екрана в пиксели screen.width  

Вертикална разделителна способност на екрана в пиксели screen.height  

Налична за приложенията ширина от потребителския екран screen.availWidth  

Налична за приложенията височина от потребителския екран (без taks bar-а) screen.availHeight  

Ширина на видимата област за документа в браузъра document.documentElement.offsetWidth
window.innerWidth  Тази стойност се променя динамично в реално време, когато размерите на браузъра биват променяни. Тази стойност включва вертикалната лента за скролиране (ако има такава), но не включва Експлорър лентата или страничната лента Sidebar. Забележка

Височина на видимата област на документа в браузъра document.documentElement.offsetHeight
window.innerHeight  Тази стойност се променя динамично в реално време, когато размерите на браузъра биват променяни. Тази стойност включва хоризонталната лента за скролиране (ако има такава), но не включва лентата Tip of the Day bar. Забележка

Ширина на прозореца на браузъра window.outerWidth  

Височина на прозореца на браузъра window.outerHeight  

Ширина на документа при настоящата височина на видимата му област в браузъра
document.documentElement.scrollWidth  

Височина на документа при настоящата ширина на видимата му област в браузъра
document.documentElement.scrollHeight  

Хоризонтално разстояние между лявата граница на потребителския браузър и лявата страна на екрана window.screenLeft window.screenX  
Тази стойност се променя при промяна на размера (не при местене, все още не) на прозореца на браузъра; тази стойност може да бъде отрицателна. MSIE 5+ пресмята разстоянието от лявата страна на областта със съдържанието (клиентска област) до лявата страна на екрана. Забележка

Вертикално разстояние от горната граница на браузъра до горната страна на екрана window.screenTop window.screenY  
Тази стойност се променя при промяна на размера (не при местене, все още не) на прозореца на браузъра; тази стойност може да бъде отрицателна. MSIE 5+ пресмята разстоянието от горната страна на областта със съдържанието (клиентска област) до горната страна на екрана. Забележка

Хоризонтално разстояние/отместване на този <div> от лявата част на неговия абсолютно позициониран най-близък родителски блок или от лявата част на общата подредба: тук e на документа ScreenData.offsetLeft -

Вертикално разстояние/отместване на този <div> от горната част на неговия абсолютно позициониран най-близък родителски блок или от горната част на общата подредба: тук то е на документа ScreenData.offsetTop -

Събития за координати на мишкатаЦъкнете за да фиксирате елемента във видимата област
X координата на мишката в областта на съдържанието (клиентска област) на браузъра
Opera 7 Internet Explorer 6 Netscape 6.x ev[en]t.clientX
Y координата на мишката в областта на съдържанието (клиентска област) на браузъра
Opera 7 Internet Explorer 6 Netscape 6.x ev[en]t.clientY
X координата на мишката в посочения елемент
Internet Explorer 6 event.offsetX Забележка
Име на текущо сочения елемент
Current target offsetParent's tagname
Тип на текущото събитие
Бр. издадени scroll събития Internet Explorer 6 Netscape 7.x
Бр. издадени mousewheel roll събития Internet Explorer 6 Netscape 7.x
Distance and direction rolled by the mousewheel
Internet Explorer 6 only event.wheelDelta
Y координата на мишката в посочения елементt
Internet Explorer 6 event.offsetY Забележка
X координата на мишката спрямо относително позициониран елемент иначе спрямо най-близкия относително позициониран съдържащ го елемент
Opera 7 Internet Explorer 6event.x Забележка
Y координата на мишката спрямо относително позициониран елемент иначе спрямо най-близкия относително позициониран съдържащ го елемент
Internet Explorer 6event.y Забележка
X координата на мишката относителна спрямо екрана
Opera 7 Internet Explorer 6 Netscape 6.x ev[en]t.screenX
Y координата на мишката относителна спрямо екрана
Opera 7 Internet Explorer 6 Netscape 6.x ev[en]t.screenY
X mouse coordinate within the whole width of the document
Opera 7 Netscape 6.x evt.pageX
Y mouse coordinate within the whole height of the document
Opera 7 Netscape 6.x evt.pageY
Разстояние в пискели между лявата страна на документа и най-лявата част видима в областа на съдържанието (клиентска област)
Internet Explorer 6 only document.documentElement.scrollLeft
Opera 7 Netscape 6.x window.pageXOffset
Разстояние в пиксели между горната страна на документа и най-горната част видима в областта на съдържанието (клиентска област)
Internet Explorer 6 only document.documentElement.scrollTop
Opera 7 Netscape 6.x window.pageYOffset

Notes about MSIE 6 and NS 6+

Expressions, terms used in reference sites

References used

Peter-Paul Koch's Properties and manipulation (via methods) of the Window object page
MasterGrid for MSIE 4 and 5 (operating systems Windows and MacIntosh), Netscape 4 and 6
http://www.quirksmode.org/viewport/compatibility.html

Web Developper Virtual Library's Grand Unified Table: events and supported properties of the event object
for Netscape 4 and MSIE 4 and 5
http://www.wdvl.com/Authoring/JavaScript/Events/table4.html

MSDN's interactive demo on measurement, dimension and location (in compatible mode only; not in standard-compliant mode)
http://msdn.microsoft.com/workshop/samples/author/css/overview/interactivemeasurement.htm

MSDN's interactive demo on measurement, object's event, scroll positions, client area (in compatible mode only; not in standard-compliant mode)
http://msdn.microsoft.com/workshop/samples/author/dhtml/overview/measure.htm

MSDN's reference on object measurement and location, scroll position, DHTML positioning properties (in compatible mode only; not in standard-compliant mode)
http://msdn.microsoft.com/workshop/author/om/measuring.asp

Major incompatibilities between MSIE 5+ and Netscape 6+

There is a major incompatibility between MSIE 5+ window.screenTop and NS 6+ window.screenY. MSIE 5+ calculates the distance from the top of the content area (client area) to the top side of the screen. NS 6+ calculates the distance from the top of the browser's window to the top side of the screen. There seems to be no way to figure out the height of chrome elements (menu bar, tools bar, address bar) present in the browser for MSIE 5+.

The same phenomenon is observed for MSIE 5+ window.screenLeft and NS 6+ window.screenX. MSIE 5+ calculates the distance from the left of the content area (client area) to the left side of the screen. NS 6+ calculates the distance from the left of the browser's window to the left side of the screen. When the MSIE 5+ Explorer Bar is displayed, we can clearly see that the window.screenLeft value is increased while when the NS 6+ Sidebar is displayed, the window.screenX value does not increase since the referenced coordinates system is different. The same phenomenon is observed for chrome bars at the top of the browser's application.

NS 6+ evt.layerX/Y properties calculate the distance from the left/top corner of an element if it is absolutely or relatively positioned; if it's not positioned, then the values are the distance from the left/top of its closest absolutely or relatively positioned containing element. In case the target element has no positioned element within the containment hierarchy, then the body element is the positioned containing element.
There appears to be 3 exceptions to this: input type="text", textarea and options in a select. When an event occurs in one of these 3 elements, regardless if they are positioned or not, the evt.layerX/Y properties will return the offset coordinates within them.

MSIE 5+ event.offsetX/Y properties calculate the distance from the left/top corner of the target element (e.g. clicking inside an image) regardless if the element is absolutely or relatively positioned or if its containment element is positioned or not. There appears to be 4 exceptions to this: for A, H, P and SPAN elements, the event.offsetX/Y will return coordinates relative to the offsetParent (which is usually - not always - the closest positioned containing element), otherwise to the BODY element.

So NS 6+ evt.layerX/Y properties are not the equivalent of MSIE 5+ event.offsetX/Y properties.

Known bugs and expected fixes for Mozilla

Bugzilla Bug #114649; Target: Future
Onresize events should fire while resizing the window, not just when the mouse stops moving.

Valid HTML 4.01! CSS compliant

© Gérard Talbot  |   Site map