prp101 prp101 - 6 months ago 12
Javascript Question

Close button doesn't work after scrolling

Okay so I got JQuery and after clicking filter icon whole < body > moves to the right,filter icon vanishes and filter list comes up,and with it close button shows up. Close button has position:fixed but problem is that after scrolling down button doesn't work anymore,and when i scroll to the top of the page it works.Here is CSS to that button.

#close{
display:none;
position:absolute;
position:fixed;
color:white;
cursor:pointer;
margin-left:210px;
}


https://plnkr.co/edit/TbOf9hkPILJn2snW8D7A
See it here. Thanks.

Answer

You may add z-index property to your css. The close button does not work any more because it is behind the other elements.

Try to change your style.css so that the #close style is:

#close{
   display:none;
   position:absolute;
   position:fixed;
   color:black;
   cursor:pointer;
   margin-left:160px;

   z-index: 100; 

}

Comments