Talk about the window object

Talk about the window object

  1. Represents the window, as the core of the BOM object.
  2. 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.
  3. 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

  1. Timeout call timer:
    setTimeout(fn,time,function parameter) returns a handle that is an id
  2. Clear the timeout call timer:
    clearTimeout(id)
  3. Intermittently call the timer:
    setInterval(fn, time, function parameter) returns a handle that is an id
  4. Clear the intermittent call timer:
    clearInterval(id)

Talk about BFC

  1. BFC (Block Formatting Context)

  2. 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.

  3. 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.

  4. BFC application
    ① Prevent the outer margin from folding.
    ② Clear the float.

Talk about the various objects and common attributes in the BOM

  1. document: Represents the entire document.
  2. screen: Represents screen information.
  3. 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.
  4. 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).
  5. 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)!

Guess you like

Origin blog.csdn.net/weixin_47021982/article/details/113264358