Returns all elements matching the given CSS selector, but ignores elements that are being destroyed or that are being removed by a transition.
By default this function only selects elements in the current layer.
Pass a { layer }
option to match elements in other layers. See up.layer.get()
for a list
of supported layer values.
Returns an empty list if no element matches these conditions.
To select all elements with the selector .foo
on the current layer:
let foos = up.fragment.all('.foo')
You may also pass a { layer }
option to match elements within another layer:
let foos = up.fragment.all('.foo', { layer: 'any' })
To select in the descendants of an element, pass a root element as the first argument:
var container = up.fragment.get('.container')
var foosInContainer = up.fragment.all(container, '.foo')
.up-destroying
class is assigned to elements during their removal animation.up.element.all()
function simply returns the all elements matching a selector
without further filtering.The root element for the search. Only the root's children will be matched.
May be omitted to search through all elements in the given layer.
The selector to match.
The layer in which to select elements.
See up.layer.get()
for a list of supported layer values.
If a root element was passed as first argument, this option is ignored and the root element's layer is searched.
The first matching element, or undefined
if no such element matched.