Skip to content
Snippets Groups Projects
Commit 5566338d authored by Andreas Gohr's avatar Andreas Gohr
Browse files

deprecated getElementsByClass

parent 0589eb71
No related branches found
No related tags found
No related merge requests found
......@@ -23,3 +23,8 @@ function findPosY(object){
return jQuery(object).position().top;
}
function getElementsByClass(searchClass,node,tag){
DEPRECATED('Use jQuery() instead');
if(node == null) node = document;
return jQuery(node).find(tag+'.'+searchClass).toArray();
}
......@@ -100,29 +100,6 @@ function isset(varname){
}
/**
* Select elements by their class name
*
* @author Dustin Diaz <dustin [at] dustindiaz [dot] com>
* @link http://www.dustindiaz.com/getelementsbyclass/
*/
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (var i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
* Get the computed style of a node.
*
* @link https://acidmartin.wordpress.com/2008/08/26/style-get-any-css-property-value-of-an-object/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment