ayjay
ayjay

Reputation: 1382

Why does `position:fixed` not work when viewed in an `iframe` using an iPhone or iOS device?

I've looked into stackoverflow and it seems that position:fixed in an iframe for iOS mobile devices has been an issue in the past but have yet to have an answer.

Here's an example I created via jsbin: http://jsbin.com/pekeca/1/

In that example, there is a parent HTML page that uses iframe which contains another HTML page (child). Here are the things to note:

Has anyone figured out a workaround for position:fixed in iPhones or iOS devices?

Upvotes: 15

Views: 11170

Answers (1)

Patrick
Patrick

Reputation: 7185

In Chrome and Safari on iOS it seems the issue here is not the fixed position, but with the height of the iframe. From another SO answer: "Starting in version 4.2.1 of Safari iOS, and still going as of 4.3.3, the entire content of an iFrame is forcibly shown."

These other posts might help you:

Upvotes: 1

Related Questions