Skip to content

Latest commit

 

History

History
60 lines (33 loc) · 1.61 KB

querySelectorAll.md

File metadata and controls

60 lines (33 loc) · 1.61 KB

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

Parameters

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 [email protected] https://olivierbossel.com

Settings

Here's the list of available setting(s).

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