examples/lib/timeline/timeline.js
function filterImageUrls (elem, urls) {
        var child = elem.firstChild;
        while (child) {
            if (child.tagName == 'IMG') {
                var url = child.src;
                if (urls.indexOf(url) == -1) {
                    urls.push(url);
                }
            }

            filterImageUrls(child, urls);

            child = child.nextSibling;
        }
    }
function filterImageUrls (elem, urls) {
        var child = elem.firstChild;
        while (child) {
            if (child.tagName == 'IMG') {
                var url = child.src;
                if (urls.indexOf(url) == -1) {
                    urls.push(url);
                }
            }

            filterImageUrls(child, urls);

            child = child.nextSibling;
        }
    }
function filterImageUrls ( elem , urls ) { var child = elem . firstChild ; while ( child ) { if ( child . tagName == 'IMG' ) { var url = child . src ; if ( urls . indexOf ( url ) == - 1 ) { urls . push ( url ) ; } } filterImageUrls ( child , urls ) ; child = child . nextSibling ; } }
Recursively retrieve all image urls from the images located inside a given
HTML element
@param {Node} elem
@param {String[]} urls   Urls will be added here (no duplicates)
Recursively retrieve all image urls from the images located inside a given HTML element