themes/iphone/scrollfix.js
changeset 4 cde92f6ec29f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/themes/iphone/scrollfix.js	Sun Mar 23 22:03:57 2008 -0400
@@ -0,0 +1,26 @@
+function getScrollOffset()
+{
+  var position;
+  if (self.pageYOffset)
+  {
+    position = self.pageYOffset;
+  }
+  else if (document.documentElement && document.documentElement.scrollTop)
+  {
+    position = document.documentElement.scrollTop;
+  }
+  else if (document.body)
+  {
+    position = document.body.scrollTop;
+  }
+  return position;
+}
+
+var fix_scroll = function()
+{
+  var div = document.getElementById('playbar');
+  div.style.top = ( String(getScrollOffset()) ) + 'px';
+}
+
+window.onscroll = fix_scroll;
+