[JQuery] css operations, jquerycss
I. Preface
Next, let's continue learning about JQuery in the previous chapter.
Ii. Content
Css sets or returns the style attribute $(selector).css (css-property-name) ((selector).css (css-property-name, value) ((selector).css ({property: value, property: value ,...}) ((selector).css (css-property-name, function (index, currentvalue) height sets or returns the height of the matching element $ (selector ). height () $ (selector ). height (num) $ (selector ). height (function (index, currentheight) width sets or returns the width of the matching element $ (selector ). width () $ (selector ). width (num) $ (selector ). width (function (index, currentwidth) position returns the position (offset) of the matching element relative to the parent element. The returned object contains two integer attributes: top and left $ (selector ). position () scrollLeft setting or return the offset of the matching element to the left of the scroll bar $ (selector ). scrollLect () $ (selector ). scrollLeft (new-position) scrollTop setting or return the vertical element of the scroll bar matching the element $ (selector ). scrollTop () $ (selector ). scrollTop (offset) offset returns or sets the offset of the matching element to the document $ (selector ). offset () $ (selector ). offset (value) $ (selector ). offset (function (index, currentoffset) offsetParent returns the most recent ancestor location element $ (selector ). offsetParent ()