jquery width() method
Translation results:
width
UK [wɪdθ] US [wɪdθ, wɪθ, wɪtθ]
n.Width; breadth
jquery width() methodsyntax
Function: width() method returns or sets the width of the matching element.
Return width: Return the width of the first matching element. If no parameters are set for this method, the width of the matched element in pixels is returned.
Syntax: $(selector).width()
Set the width: Set the width of all matching elements.
Syntax: $(selector).width(length)
##Parameters:
Description | |
Optional. Specifies the width of the element. If no length unit is specified, the default px unit is used. |
#Use a function to set the width: Use a function to set the width of all matching elements.
Syntax: $(selector).width(function(index,oldwidth))
Parameters:
Description | |
Specifies to return the new width of the selected element function. | |
Optional. Accepts the index position of the selector | |
Optional. Accepts the current value of the selector. |