Coffeekraken.io 0.0.1

querySelectorAll

Enhanced proxy of the Element.querySelectorAll function that let you specify if you want elements that are visible, or even that are in the viewport

Name Type Description Status Default
selector { String } The css selector to search required
settings { Object } required

Return { Array } The founded elements

Example

    // simple query
const elms = querySelectorAll('.a-cool-css-selector');

// get elements that are in the viewport
const elms = querySelectorAll('.a-cool-css-selector', {
        inViewport : true
});

Author : Olivier Bossel olivier.bossel@gmail.com

Settings

Here's the list of available settings.

visible

If we want only visible elements

Type : { Boolean }

Default : false

inViewport

If we want only elements that are in the viewport

Type : { Boolean }

Default : false

rootNode

The root node to start the query from

Type : { HTMLElement }

Default : document.body