jquery Learning Note manipulation jquery object CSS processing _jquery

Source: Internet
Author: User

CSS Basic Property Handling

Method

Describe

CSS (name)

Gets the Name property value of the CSS rule on the element

CSS (Name,value)

CSS (NAME,FN (index,value))

css ({name1:value1,..., namen:valuen})

Set the value of the CSS Rule Name property on the element, or use the function argument, without explanation; You can also set multiple CSS properties for the same element at once

CSS Dimension Property Handling

Method

Describe

Height ()

Gets the value of the element's CSS property height

Width ()

Gets the value of the element's CSS attribute width. These two methods get the actual height width of the element in the page, which is more convenient for mathematical operation.

Innerheight ()

Gets the actual height value of the inner area of an element, including the inner margin padding

Innerwidth ()

Gets the actual width value of the inner area of an element

Outerheight ()

Gets the actual height value of the outer area of the element (including the inner margin padding, border border)

Outerwidth ()

Gets the actual width value of the outer region of the element. If you want to count the outer margin margin, you can pass in a true parameter, i.e. Outerheight (true) or outerwidth (true)

CSS position attribute handling

Method

Describe

Offset ()

Offset (coord)

Offset (FN (Index,coord))

Gets the relative offset of the element in the current window, and returns an object that contains the top and left properties. such as $ ("P"). Offset (). Top. This method is valid only for visible elements. You can also set an offset value, noting that Coord is also an object, such as $ ("P"). Offset ({"Top":, "Left": 15})

Position ()

Gets the offset value of the element relative to the most recently positioned ancestor element, and also returns an object that contains the top and left properties.

ScrollTop ()

ScrollTop (value)

Gets the offset value of the vertical scroll bar relative to the top of the element

ScrollLeft ()

ScrollLeft (value)

Gets the offset value of the horizontal scroll bar relative to the leftmost edge of the element. Both methods can set the value, the default unit PX, and if value is negative, the scroll bar moves to the top or the left, and if value exceeds the maximum, it moves to the bottom or right end.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.