1.css
1.1 CSS (name)
$ (function () {
Alert ($ ("P"). CSS ("color"));
})//rgb (255,0,0)
1.2 css (JSON) where the value of the JSON array is function (Index,value) {return parsefloat (value) *1.2}, where the JSON object member is the property
$("div").click(function() {
$(this).css({ width: function(index, value) { return parseFloat(value) * 1.2; }, height: function(index, value) { return parseFloat(value) * 1.2; } }); });
1.3 css (Name,value)
Where name value is the object property and value
("P"). CSS ("Color", "red");
1.4 CSS (JSON) writes the individual values of the Set object as JSON to set the object's properties
$("p").css({ "margin-left": "10px", "background-color": "blue" });
2 location
2.1 Offset ()
Gets the relative offset of the matching element at the current viewport.
var offset= ("div"). offset ();
var offsetleft=offset.left;
var offsettop=offset.top;
2.2 Offset (coordinate)
Sets the coordinates of the matching element relative to the document object.
("div"). Offset ({left:20px,top:20px});
2.3 Position () usage with offset () (Supplemental: var p = $("p:first"); 选取p标签的第一个节点 )
Gets the offset of the matching element relative to the parent element.
2.4 scrollleft () and ScrollLeft (Val)
Gets the offset to the left of the matching element relative to the scrollbar.
3. Dimensions
3.1 Width () and width (val)
Height () and height (val)
3.2 innerwidth () and Innerheight () gets the length and width of objects that do not include borders
3.3 Outerheight (Boolean) Outerwidth (Boolean) If true, the bounding rectangle is calculated instead of
CSS in jquery