I have:
<body> //positioned relative
<div id="box"></div> //positioned absolute
</body>
I want to make a function that when called will position "box"
relative to the viewport (cross-browser). I can''t seem to figure this
one out with prototype. I''ve tried Position.page, but I can''t
get that
to work.
My non-prototype solution is:
if (document.documentElement && document.documentElement.scrollTop)
{
$(''box'').style.top = document.documentElement.scrollTop +
"px";
}
else if (document.body)
{
$(''box'').style.top = document.body.scrollTop +
"px";
}
Any help appreciated,
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---