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