JQuery learning notes operations jQuery object CSS Processing

Source: Internet
Author: User

CSSBasic Property Processing

Method

Description

Css (name)

Obtains the name attribute value in the CSS rule on an element.

Css (name, value)

Css (name, fn (index, value ))

Css ({name1: value1,..., NameN: valueN })

Set the value of the CSS rule name attribute on an element to value. You can also use function parameters without explanation. You can also set multiple CSS attributes for the same element at a time.

CSSDimension attribute Processing

Method

Description

Height ()

Obtains the height value of the element CSS attribute.

Width ()

Obtains the width value of the element CSS attribute. These two methods obtain the actual height and width values of the elements on the page. They are mostly used for mathematical operations and are more convenient.

InnerHeight ()

Obtains the actual height value of the element's internal area (including the padding ).

InnerWidth ()

Obtains the actual width of the area inside the element.

OuterHeight ()

Obtains the actual height of the element's external area (including the padding and border ).

OuterWidth ()

Obtains the actual width of the external area of an element. To include the margin, You can input a true parameter, namely, outerHeight (true) or outerWidth (true)

CSSLocation attribute Processing

Method

Description

Offset ()

Offset (coord)

Offset (fn (index, coord ))

Obtains the relative offset of an element in the current window and returns an object containing the top and left attributes. For example, $ ("p"). offset (). top. This method is only valid for visible elements. You can also set the offset value. Note that coord is also an object, such as $ ("p"). offset ({"top": 40, "left": 15 })

Position ()

Returns an object that contains the top and left attributes.

ScrollTop ()

ScrollTop (value)

Obtains the Offset Value of the vertical scroll bar relative to the top of the element.

ScrollLeft ()

ScrollLeft (value)

Obtains the Offset Value of the horizontal scroll bar relative to the leftmost side of the element. The default unit is px. If the value is negative, the scroll bar is moved to the top or left side. If the value exceeds the maximum value, it is moved to the bottom or right side.

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.