Library Functions
Object Information
| Function | Attributes | Description |
|---|---|---|
| getElementNumber(element) | object HTML element | Returns the number of an element on the same sibling with similar tags. See function counter() for example. |
| classOrIDexists(classOrIDstring, classOrID) | string, class | id | Checks if string class / id has been defined in given class / id. |
| getPropertyValue(styles, style, defaultValue) | array of style defintions, searched style, default value for return | Returns the value of a style defintion. |
| getShorthand(shorthandString) | Shorthand value string | Returns an array with the two or more parts of a shorthand value. See function textSlice() for example. |
| getStyle(element, property) | object HTML element, searched property name | Returns the value of a computed style. |
| browser() | none | Returns the name of the client browser (Safari, WebKit, KHTML, Opera, MSIE, Mozilla). |
| getParentNodeByTagName(tag, node) | tag name, node element | Returns the parent node element object of an element. |
Sizes and Dimensions
| Function | Attributes | Description |
|---|---|---|
| innerSize(mode) | width | height | Returns window inner width or inner height. |
| getPosition(position, size, mode) | string position, element width | height, screen | window | Returns x or y position in pixel out of a string position (e.g “center” in mode “window” returns distance from left window edge to element). See function target for example. |
| getSize(type, size, mode, element) | width | height, percent value, screen | window | element, [object HTML element] | Returns size in pixel of a window or element depending to screen or window edges out of a percent value (e.g “100%” in mode “element” returns the possible max width of the element). See function target for example. |
| proportionalResize | width, height, max width, max height | Returns an array with proportional resized width and height depending on their maximum values. |
String Operations
| Function | Attributes | Description |
|---|---|---|
| trim(string, mode) | string, [quotes | commas] | Strip whitespace and quotes or commas from the beginning and end of a string. |
| removeClassName(classString, className) | class string of element, class name to remove | Returns the class string without the class name. See function MoreCSS.removeClass() for example. |
Operations
| Function | Attributes | Description |
|---|---|---|
| createXMLHttpRequest() | none | Returns a XML/HTTP request object to init file access via AJAX. See function MoreCSS.includeContent() for example. |
| triggerEvent(element, event) | element, event name |
Triggers an event to the element. For example to trigger a click on a link. See function MoreCSS.command() for a working example. |
| includeScript(filePath, fileType) | file path, [css | js] | Includes a CSS or JavaScript file given by attribute file path. |
| eventListener(mode, element, type, listener, useCapture) | [add | remove], element, event name, function name, bool | Adds or removes an event listener (e.g. 'onclick'). |
