Javascript button sometimes working and sometimes not

Check if you used Z index in button tag may be you have in mind that after 
I clicked button, the button will go -1 so, we can easily hide the button by
overlay of the desired element you need to place at z - index:1.
In simple words, You may think you need to hide the button if the button is
pressed and a other div or p tag must come over it.
If you do that your ideology is right I mean that It will be z=-1.SO, the
element gets hidden task completed. But the thing is the buttom will become 
unclickable at 'Certain parts', it specifically clickable at right or left top corner. 
Just imagine a co-ordinate system of (x,y,z) if you put your index -1 then 
it will be on negative side of the system.To visualize or understand
what I am saying. Just consider a cornor in your house it has an upright 
axis or (the line that is moving towards the  top) Z(our concern). The three
lines meet at a point called origin. in our assumpation the corner of our house 
from which lines orginate. so let us give values to z axis consider z=1
(distance of z=1) when z=-1 it is the backside of the corner. that is you
are looking the corner from positive side, the negative side of corner cant be
seen by you because it backside. In 2 dimensional window there is no backside
so we need to use a good old trick that is say we draw a person is watching a bird
coming from long distance in order to get that optical illusion that to say the bird long away
we usually draw the bird smaller such that the observer feel it is kind of 3d.
Excat senario happens in browser window but this time the click function 
that is associated with buttom is becoming smaller rather than the button itself
So if you read this completely you will know how "Z-INDEX WORKS".
In short "Remove Z-index".if you have it.
 

Are there any code examples left?
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source