2
I am working on a project where I use bootstrap modals, for a problem of overlapping some elements, I needed to use a script that always assigns the highest value z-index
+10 from the page to the new modal opened, so there is no such problem.
I happen to be using another plugin that shows notifications at the top of the screen, and notifications are getting behind the modal.
To get the biggest z-index of the page I use the following code:
var zIndex = Math.max.apply(null,Array.prototype.map.call(document.querySelectorAll('*'), function (el) {
return +el.style.zIndex;
})) + 10;
Is there any way to keep picking all selectors (*) except the class .notifications
with the .querySelectorAll()
?
Try to use
not
to delete, something like:querySelectorAll('*:not(.notifications)')
– BrTkCa
@Lucascosta Perfect, thanks.
– Mathiasfc