JQuery CSS Detailed

Source: Internet
Author: User

Today really is actually put a day off, drink a little wine, see the daily progress and happy base camp and Chinese good dance, more and more love dance, or summarize an article bar.

@jquery CSS

CSS (NAME|PRO|[,VAL|FN): Access or set style properties for matching elements

1 $ ("div"). Click (function() {2     $ (this). css ({width:20px, height:30px})3 });

offset ([coordinates]): Gets the relative offset of the matched element at the current viewport (body)

1 <p>hello baby</p>23 $ ("P"). HTML ("Left:" +offset.left+ ", Top:" +  Offset.top); 4 5 // offset (). Left is equivalent to the body of the Margin-left 6 // offset (). Top is equivalent to the body of the Margin-top

Position (): Gets or sets the offset of the matching element relative to the parent element

1 $ ("P"). HTML ("Left:" +$ ("P"). Position (). 2 3 // position (). Left corresponds to the margin-left of the current parent element; 4 // position (). Top corresponds to the margin-top of the current parent element;

ScrollTop ([Val]): Gets the offset of the matched element relative to the top of the scroll bar;

ScrollLeft ([Val]): Gets the offset of the matched element relative to the left part of the scrollbar;

Height (VAL|FN): Gets or sets the current calculated height value (height) of the matching element

1 $ ("P"). Height (20);

Width (VAL|FN): Gets or sets the width value (width) of the current calculation of the matching element;

Innerheight (): Gets the first matching element interior area height (height + filler)

Innerwidth (): Gets the inner area width of the first matching element;

Outerheight ([options]): Gets the outer height of the first matching element;

1 <p>HELLObaby</p>23 $ ("P"). HTML ("Outerheight:" +$ ("P"). Outerheight () + ", Outerheight (True): "+$ (" P "). Outerheight (true)); 4 5 // Outerheight () indicates the height + filler + border, when the parameter is True, indicates the height + padding + border + margin;

Outerwidth ([options]): Gets the outer width of the first matching element;

Summary is not enough refining, but also need to gradually improve!!

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.