0

I've got position:fixed; container and it is always fixed when I sroll page on PC (remains on the top left corner).

On iPhone it appears on the top left corner but it stays there forever as I scroll. Is there any solution to that?

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Atadj
  • 7,050
  • 19
  • 69
  • 94

1 Answers1

1

The best option here seems Media Queries, see: http://www.w3.org/TR/css3-mediaqueries/ and http://webdesignerwall.com/tutorials/css3-media-queries for examples.

edit: Miss read the question:

As Josh' link suggests you can achieve this by:

window.onscroll = function() {
  document.getElementById('fixedDiv').style.top =
    (window.pageYOffset + window.innerHeight - 25) + 'px';
};
NickGreen
  • 1,742
  • 16
  • 36
  • Looks like position: fixed; will be supported in iOS 5. I'll use your solution for iPhone 2G and iPhone 3G. – Atadj Mar 14 '12 at 16:30