shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
querySelectorAll
Type:Function
Status:stable
Since:1.0.0
Platform:js
@blackbyte.sugar.js.dom.query
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
Params
- selector*-String
The css selector to search
- settings*-Object
The settings of the query
Return
- -Array}<HTMLElement>
The founded elements
Example
import { querySelectorAll } from '@blackbyte/sugar/dom';
// 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
});Settings
- visible-Boolean
Specify if you want only the visible nodes
- inViewport-Boolean
Specify if you want only the nodes that are in the viewport
- $rootNodedocument.bodyHTMLElement
Specify the root node from where you want to query
Todo
- testsnormal
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space