1

I have a button that is fixed on my page and when you start to scroll it appears. I noticed on ipad safari I have to click this button twice to fire the click event once.

After searching around I found this sure enough when I commented out my "display:none" on the button it works.

How can I achieve having it hidden and then changing it to "display:block" without getting this double click issue?

chobo2
  • 83,322
  • 195
  • 530
  • 832

1 Answers1

0

You can use css position instead to place it off screen:

.hide {
   position: absolute;
   left: -999em;
}

You could also try the visibility property

.hide {
   visibility: hidden;
 }

w3c example

floor
  • 1,519
  • 11
  • 24
  • thanks, maybe it is not the hidden that is the cause, I am still getting the same thing with your suggestions. – chobo2 Nov 15 '17 at 16:13
  • @chobo2 what about changing the buttons opacity? opacity: 0 Even moving the button off screen didn't work? – floor Nov 15 '17 at 17:12