element position differ due to scrollbar

0 views
Skip to first unread message

kuldeep

unread,
Apr 4, 2009, 7:24:08 AM4/4/09
to Prototype & script.aculo.us
hi frds,
I have div in my code with the help javascript i cover that portion
black shaded background on loading. but if i scroll my page it wont
get exect position. it come different place.so any one why this
happening.

Maarten

unread,
Apr 4, 2009, 9:12:33 AM4/4/09
to Prototype & script.aculo.us
Hi,

I have no experience with this, but I would give getScrollOffsets a
try:

window.scrollTo(0, 120);
document.viewport.getScrollOffsets();
//-> { left: 0, top: 120 }

See http://www.prototypejs.org/api/document/viewport/getscrolloffsets.
Reply all
Reply to author
Forward
0 new messages