Background won't be foreground with jquery

My question is, is it possible to get background images in the foreground?

I created mask from example with div z-index up to 9000 and div containing shape z-index up to 9999

So far this works, but if I use the class with a background image it won't show.

I tested everything on a test page without mask and it works. Then I moved the stuff to the page using a mask and then the background images no longer show.

Regular images don't seem to have this problem.

This is my test page

// het tbnote opties menu
    $("#tbnoteopties").click(function() {
            $(this).toggleClass("uit").toggleClass("aan");
            $(this).next().toggleClass("expanded").toggleClass("collapsed").slideToggle("normal");
    });

      

0


a source to share


1 answer


z-index

determines the level of the element stack. Each element is automatically assigned a z-index based on its context in the document.

z-index

will only work on elements that are explicitly assigned a value position

absolute

, fixed

or relative

.



You cannot set a z-index

background image. z-index

sets the stacking order of the html element.

If you are trying to position a background image that is set using a property background

or background-image

css, you end up positioning the element not the background image in the element.

0


a source







All Articles