--- a/scripts/volume.js Sun Nov 23 23:49:20 2008 -0500
+++ b/scripts/volume.js Sun Nov 23 23:53:29 2008 -0500
@@ -95,7 +95,7 @@
box.appendChild(field);
$(box)
- .css('top', (( getHeight() / 2 ) - ( $(box).Height() / 2 )) + 'px')
+ .css('top', (( getHeight() / 2 ) - ( $(box).Height() / 2 ) + getScrollOffset()) + 'px')
.css('left', (( $(document.body).Width() / 2 ) - ( $(box).Width() / 2 )) + 'px');
$(box).fadeIn(250);
@@ -163,3 +163,27 @@
}
return myWidth;
}
+
+function getScrollOffset(el)
+{
+ var position;
+ var s = el || self;
+ el = el || document;
+ if ( el.scrollTop )
+ {
+ position = el.scrollTop;
+ }
+ else if (s.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;
+}