Collection of useful small javascript function.
Determine if the given elements is assigned to the given class.
hasClass(_item, _class);
- _item, object (Required) : Object to test
- _class, string (Required) : Class to test
- Boolean
Add a class to the given element.
addClass(_item, _class);
- _item, object (Required) : Object that will receive the new class
- _class, string (Required) : Class to add
Remove a single class to the given element.
removeClass(_item, _class);
- _item, object (Required) : Object that will lose the given class
- _class, string (Required) : Class to delete
Set multiple styles to a given object
setStyle(_item, _styles);
- _item, object (Required) : Object that will receive the given styles
- _styles, array (Required) : Array of objects ({'width' : '100%', 'height' : '100%'})
Remove all the empty node (white-space) of an objects list.
cleanWhitespace(_node);
- _node, objects (Required) : Objects list that will be treat
- objects
http://www.quirksmode.org/js/detect.html
Detect Browser and Browser Version
BrowserDetect.init();
- object
http://paulirish.com/2011/requestanimationframe-for-smart-animating/ http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
MIT license
=======================
- v1.0 Initial Release (Class Tools, RemoveWhiteSpace)
- v1.1 (setStyle, BrowserDetect, requestAnimationFrame)
Created by Crucifix Arnaud (crucifixarnaud.com)
This is free and unencumbered software released into the public domain. (http://unlicense.org)