The template use several internal functions to determine how to work with the browser, and these are available for your scripts.
The template does a bit of browser sniffing, and though this is not completely reliable, it helps sometimes.
The template uses a lot the viewport sizes, so they are retrieved and stored once here to speed up the whole scripts.
The template provides a fallback for position:fixed, as it is used for the navigation menu but wasn't supported either by iOs before version 5 nor by older versions of Android.
The fallback works by adding elements with javascript:
$(selector).enableFixedFallback();
You can also disable it:
$(selector).disableFixedFallback();
Parse a css numeric value
@param jQuery element the element whose property to parse
@param string prop the name of the property
@param int def the default value if parsing fails (default: 0)
@return the parsed css value, or def
Test if an element has an inline CSS property set
@param string prop the name of the property
@return boolean true if set, else false
Return the element inline style string
Note: for IE, the node.style.cssText is not raw, but as parsed by the browser (http://javascript.gakaa.com/style-csstext.aspx)
@return string the style string
@url http://stackoverflow.com/questions/4233273/howto-get-cross-browser-literal-style-string-with-javascript
Get immediate siblings matching a selector at the beginning of a selection:
The filter stops as soon as non-matching node is found
@param string selector any jQuery selector string
@param boolean fromLast use true to filter from the last element (default: false)
@return the matching immediate siblings
Get immediate previous siblings matching a selector
Different from prevAll() as it stops as soon as non-matching node is found
@param string selector any jQuery selector string
@return the matching immediate previous siblings
Get immediate next siblings matching a selector
Different from nextAll() as it stops as soon as non-matching node is found
@param string selector any jQuery selector string
@return the matching immediate next siblings
Get immediate children siblings matching a selector
Different from nextAll() as it stops as soon as non-matching node is found
@param string selector any jQuery selector string
@param boolean fromLast use true to filter from the last element (default: false)
@return the matching immediate next siblings
Remove an element with folding effect
@param string|int duration a string (fast, normal or slow) or a number of millisecond. Default: 'normal'. - optional
@param function callback any function to call at the end of the effect. Default: none. - optional
Remove an element with fading then folding effect
@param string|int duration a string (fast, normal or slow) or a number of millisecond. Default: 'normal'. - optional
@param function callback any function to call at the end of the effect. Default: none. - optional
Shake an element
The jQuery UI's bounce effect messes with margins so let's build ours
@param int force size (in pixels) of the movement (default: 15)
@param function callback any function to call at the end of the effect. Default: none. - optional