Safari IOS6 "position: fixed" with the keyboard open and the orientation changed

I have a top menu in Ipad with position: fixed and width: 100% on my site that displays well when the keyboard is displayed and the orientation (fe, from Landscape to Portrait) changes in Safari IOS5, but not in IOS6.

In iOS6, after this action, the top menu shifts to the right by 128px . I found a very close problem related exactly to 128px in the StackOverflow iOS6 Safari orientation change error? but the solution is not applicable to my case.

So, after a little understanding, I changed the "changechange" event CSS property of the top menu position:fixed to position:relative in javascript.

And it helped, my menu came back correctly. But, since I needed the exact position:fixed later for my site, I added the setTimeout() method, which returned the CSS position back to fixed .

 $(window).bind("orientationchange", function(e){ $('#framecontentTop').css('position', 'relative'); setTimeout(function(e){ $('#framecontentTop').css('position', 'fixed'); }, 500) }); 

I think this is a temporary solution. Does anyone know the real cause of the problem, or is it an iOS6 bug?

+4
source share

All Articles