table of Contents
Talk about the window object
- Represents the window, as the core of the BOM object.
- It replaces the function of the top-level object global specified by ECMAScript. As a global object, it contains all global methods and global properties.
- Global variables and global functions are methods and properties of the window object.
Two kinds of timer writing method and return value and clear timer
- Timeout call timer:
setTimeout(fn,time,function parameter) returns a handle that is an id - Clear the timeout call timer:
clearTimeout(id) - Intermittently call the timer:
setInterval(fn, time, function parameter) returns a handle that is an id - Clear the intermittent call timer:
clearInterval(id)
Talk about BFC
-
BFC (Block Formatting Context)
-
The creation of BFC
① Root element (html).
② Floating element (float is not none).
③ Absolutely fixed positioning element (position is absolute or fixed).
④ Inline block element (display is inline-block).
⑤ The value of overflow is not an element that is visible. -
Features of BFC
① Create an isolated space.
② The block-level boxes inside the BFC will be arranged one by one in the vertical direction.
③ Adjacent block-level elements under the same BFC may collapse margins. -
BFC application
① Prevent the outer margin from folding.
② Clear the float.
Talk about the various objects and common attributes in the BOM
- document: Represents the entire document.
- screen: Represents screen information.
- history: Represents historical records.
go( ): Numbers can be written in it, indicating the number of pages to go forward or backward, and a negative number means to go back.
back( ): Go back a page.
forward( ): Forward one page. - navigator: Represents browser information.
platform: Stores information related to the browser.
onLine: Indicates true and false network connection status.
userAgent: User agent string (browser identification code). - location: represents the url address of the browser.
href: Declare or get the full URL of the current document.
reload: reload.
replace: Jump and replace the original URL.
Mnemonic: Hit (document) and die (screen) you (navigator) is good (history) (location)!