Namespace Pot.Style
Defined in: <pot.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
CSS utilities.
|
Method Attributes | Method Name and Description |
---|---|
<static> |
Pot.Style.css(elem, name, The)
Get or set the element's style.
|
<static> |
Pot.Style.getCascadedStyle(elem, style)
Gets the cascaded style value of a node, or null.
|
<static> |
Pot.Style.getComputedStyle(elem, prop)
Get the computed style value of a node.
|
<static> |
Pot.Style.getHeight(elem, height)
Gets the width to the element.
|
<static> |
Pot.Style.getOpacity(el)
Gets the opacity of a node.
|
<static> |
Pot.Style.getPixelSize(elem, (extra))
Gets the height and width of an element.
|
<static> |
Pot.Style.getResizeSize(orgWidth, orgHeight, maxWidth, (maxHeight))
Gets the resize size.
|
<static> |
Pot.Style.getSizePos(elem)
Gets the height and width and position of an element.
|
<static> |
Pot.Style.getStyle(elem, styleName)
Get the style value.
|
<static> |
Pot.Style.getWidth(elem, extra)
Gets the width to the element.
|
<static> |
Pot.Style.isShown(elem)
Check whether the element is shown.
|
<static> |
Pot.Style.isVisible(elem)
Check whether the element is visible.
|
<static> |
Pot.Style.pxize(value, round)
Add 'px' suffix to integer value.
|
<static> |
Pot.Style.setHeight(elem, width)
Sets the height to the element.
|
<static> |
Pot.Style.setOpacity(el, alpha)
Sets the opacity of a node.
|
<static> |
Pot.Style.setPreWrap(el)
Sets 'white-space: pre-wrap' for a node.
|
<static> |
Pot.Style.setSize(elem, width, height)
Sets the width and height to the element.
|
<static> |
Pot.Style.setStyle(elem, name, (value))
Set the style value.
|
<static> |
Pot.Style.setWidth(elem, width)
Sets the width to the element.
|
<static> |
Pot.Style.toString()
Return the string representation of object.
|
Method Detail
<static>
{Function}
Pot.Style.css(elem, name, The)
Get or set the element's style.
- Parameters:
- {Element} elem
- The target element node.
- {String|Object} name
- Get the style if you pass a string. Set each styles if you pass an object.
- {String|*} The
- value to set.
- Returns:
- {*} Return the obtained style value, or if you set the value then will return the element.
<static>
{Function}
Pot.Style.getCascadedStyle(elem, style)
Gets the cascaded style value of a node, or null.
- Parameters:
- {Element} elem
- Element to get style of.
- {String} style
- Property to get (camel-case).
- Returns:
- {String} Style value.
<static>
{Function}
Pot.Style.getComputedStyle(elem, prop)
Get the computed style value of a node.
- Parameters:
- {Element} elem
- Element to get style of.
- {String} prop
- Property to get (camel-case).
- Returns:
- {String} Style value.
<static>
{Function}
Pot.Style.getHeight(elem, height)
Gets the width to the element.
- Parameters:
- {Element} elem
- Element to get width of.
- {Number} height
- Specify width.
- Returns:
- {Number} Object width.
<static>
{Function}
Pot.Style.getOpacity(el)
Gets the opacity of a node.
- Parameters:
- {Element} el
- Element whose opacity has to be found.
- Returns:
- {Number|String} Opacity between 0 and 1 or an empty string.
<static>
{Function}
Pot.Style.getPixelSize(elem, (extra))
Gets the height and width of an element.
- Parameters:
- {Element} elem
- Element to get width of.
- {Boolean} (extra)
- Whether include margin.
- Returns:
- {Object} Object with width/height properties.
<static>
{Function}
Pot.Style.getResizeSize(orgWidth, orgHeight, maxWidth, (maxHeight))
Gets the resize size.
- Parameters:
- {Number} orgWidth
- Original width.
- {Number} orgHeight
- Original height.
- {Number} maxWidth
- Maximum width.
- {(Number)} (maxHeight)
- (Optional) Maximum height.
<static>
{Function}
Pot.Style.getSizePos(elem)
Gets the height and width and position of an element.
- Parameters:
- {Element} elem
- Element to get width of.
- Returns:
- {Object} Object with width/height/left/top properties.
<static>
{Function}
Pot.Style.getStyle(elem, styleName)
Get the style value.
- Parameters:
- {Element} elem
- Element to get style of.
- {String} styleName
- Property to get.
- Returns:
- {String} Style value.
<static>
{Function}
Pot.Style.getWidth(elem, extra)
Gets the width to the element.
- Parameters:
- {Element} elem
- Element to get width of.
- extra
- Returns:
- {Number} Object width.
<static>
{Function}
Pot.Style.isShown(elem)
Check whether the element is shown.
- Parameters:
- {Element} elem
- The target element node.
- Returns:
- {*} Return whether the element is shown.
<static>
{Function}
Pot.Style.isVisible(elem)
Check whether the element is visible.
- Parameters:
- {Element} elem
- The target element node.
- Returns:
- {*} Return whether the element is visible.
<static>
{Function}
Pot.Style.pxize(value, round)
Add 'px' suffix to integer value.
- Parameters:
- {String|Number} value
- The numeric value.
- {Boolean} round
- Whether to round the nearest integer.
- Returns:
- {String} The string value for the property.
<static>
{Function}
Pot.Style.setHeight(elem, width)
Sets the height to the element.
- Parameters:
- {Element} elem
- Element to get height of.
- {Number} width
- Specify height.
- Returns:
- {Number} Object height.
<static>
{Function}
Pot.Style.setOpacity(el, alpha)
Sets the opacity of a node.
- Parameters:
- {Element} el
- Elements whose opacity has to be set.
- {Number|String} alpha
- Opacity between 0 and 1 or an empty string to clear the opacity.
<static>
{Function}
Pot.Style.setPreWrap(el)
Sets 'white-space: pre-wrap' for a node.
There are as many ways of specifying pre-wrap as there are browsers.
CSS3/IE8: white-space: pre-wrap; Mozilla: white-space: -moz-pre-wrap; Opera: white-space: -o-pre-wrap; IE6/7: white-space: pre; word-wrap: break-word;
- Parameters:
- {Element} el
- Element to enable pre-wrap for.
<static>
{Function}
Pot.Style.setSize(elem, width, height)
Sets the width and height to the element.
- Parameters:
- {Element} elem
- Element to get width of.
- {Number} width
- Specify width.
- {Number} height
- Specify height.
<static>
{Function}
Pot.Style.setStyle(elem, name, (value))
Set the style value.
- Parameters:
- {Element} elem
- Element to set style of.
- {String|Object} name
- Style name string or key-value object.
- {String|*} (value)
- Style value.
- Returns:
- {Boolean} Success or failure.
<static>
{Function}
Pot.Style.setWidth(elem, width)
Sets the width to the element.
- Parameters:
- {Element} elem
- Element to get width of.
- {Number} width
- Specify width.
- Returns:
- {Number} Object width.
<static>
{Function}
Pot.Style.toString()
Return the string representation of object.
- Returns:
- {String} The string representation of object.