Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android checkbox hack causes moving site on iPhone

I have been using the Advanced checkbox hack to hide and show my responsive menu. The hack is necessary to allow Android <4.1.2 to actually tap the toggle--it doesn't work without the hack.

Now it turns out that the animation part of the hack

body { 
  -webkit-animation: bugfix infinite 1s; 
}
@-webkit-keyframes bugfix { 
  from {padding:0;} 
  to {padding:0;} 
}

causes actual movement in at least an iPhone. How do I prevent this hack from ruining the site experience for iPhone users?

I have a preview live with the error over here. A movie with the error visible is seen here.

like image 824
Bakabaka Avatar asked Sep 15 '15 11:09

Bakabaka


1 Answers

I don’t have an Android to test this but wont the hack also work when just applied to one element instead of the entire body?

.toggle {
  -webkit-animation: bugfix infinite 1s;
}

@-webkit-keyframes bugfix {
  from { padding: 0; }
  to { padding: 0; }
}

As long as you don’t have any padding on that element

like image 194
Vincent Orback Avatar answered Nov 15 '22 04:11

Vincent Orback