Today's Notes:
1. keyboard monitoring direction key;
2. Get a high width of the visible area of the web screen;
3. Get object location information.
1. Keyboard monitoring direction key, the corresponding key value of the next and next to 38, 40, 37, 39
Document.onkeydown =function(e) {varKey = Window.event?E.keycode:e.which; Switch(key) { Case37:// Left //TODO Break; Case38:// up //TODO Break; Case39:// Right //TODO Break; Case40:// Down //TODO Break; }};
2. Get a high width of the web screen visible area
Document.body.clientWidth//Body Object width
Document.body.clientHeight//body Object Height
Document.documentElement.clientWidth//Visible area width
Document.documentElement.clientHeight//Visible area height
Document.body.clientWidth//Web page visible area width
Document.body.clientHeight//Web page visible Area high
Document.body.offsetWidth (including edge width)//web page visible area width
Document.body.offsetHeight (including edge height)//web page visible Area high
Document.body.scrollWidth//page body Full text width
Document.body.scrollHeight//The full text of the Web page is high
Document.body.scrollTop//page is rolled away high
Document.body.scrollLeft//page is rolled away to the left
Window.screentop//Page body part
Window.screenleft//Page body part left
Window.screen.height//High screen resolution
Window.screen.width//width of screen resolution
Window.screen.availHeight//Screen available work area height
Window.screen.availWidth//Screen available work area width
3. Get Object location information
ScrollHeight//Gets the scroll height of the object.
ScrollLeft//Sets or gets the distance between the left edge of the object and the leftmost of the currently visible content in the window
ScrollTop//Sets or gets the distance between the top of the object and the top of the visible content in the window
ScrollWidth//Gets the scrolling width of the object
Offsetheight//Gets the height of the object relative to the layout or parent coordinates specified by the parent coordinate OffsetParent property
Offsetleft//Gets the calculated left position of the object relative to the layout or the parent coordinate specified by the OffsetParent property
OffsetTop//Gets the computed top position of the object relative to the layout or the parent coordinate specified by the OffsetTop property
EVENT.CLIENTX//Relative document level coordinates
Event.clienty//Relative document vertical coordinates
EVENT.OFFSETX//relative container horizontal coordinates
Event.offsety//Relative container vertical coordinates
Document.documentElement.scrollTop//Vertical scrolling values
Event.clientx+document.documentelement.scrolltop//Relative to the document's horizontal coordinates + the amount of scrolling in the vertical direction
Daily Notes 20150608