public/theme/js/scripts.js
/**
    * Iterate over each of the provided element(s).
    *
    * @param {HTMLElement|HTMLElement[]} elements
    * @param {Function}                  callback
    */
Iterate over each of the provided element(s).
Iterate over each of the provided element ( s ) .
function forEachElement(elements, callback){
       var elementsType = Object.prototype.toString.call(elements);
       var isCollectionTyped = ('[object Array]' === elementsType
           || ('[object NodeList]' === elementsType)
           || ('[object HTMLCollection]' === elementsType)
           || ('[object Object]' === elementsType)
           || ('undefined' !== typeof jQuery && elements instanceof jQuery) 
           || ('undefined' !== typeof Elements && elements instanceof Elements) 
       );
       var i = 0, j = elements.length;
       if (isCollectionTyped) {
           for (; i < j; i++) {
               callback(elements[i]);
           }
       } else {
           callback(elements);
       }
   }
function forEachElement ( elements , callback ) { var elementsType = Object . prototype . toString . call ( elements ) ; var isCollectionTyped = ( '[object Array]' === elementsType || ( '[object NodeList]' === elementsType ) || ( '[object HTMLCollection]' === elementsType ) || ( '[object Object]' === elementsType ) || ( 'undefined' !== typeof jQuery && elements instanceof jQuery ) || ( 'undefined' !== typeof Elements && elements instanceof Elements ) ) ; var i = 0 , j = elements . length ; if ( isCollectionTyped ) { for ( ; i < j ; i ++ ) { callback ( elements [ i ] ) ; } } else { callback ( elements ) ; } }
Iterate over each of the provided element(s).
Iterate over each of the provided element ( s ) .
//jquery //mootools