When your event fires just get the scroll properties from the window, Prototype has a convenient method just for this purpose.
http://prototypejs.org/api/document/viewport/getscrolloffsets -- http://positionabsolute.net On Jun 11, 9:30 am, Jeztah <webmas...@thecarmarketplace.com> wrote: > At the time of a function call is it possible to work out where the > user is on the page (scroll wise) without something being clicked or > moved..... > > I have an error function i built and it scrolls down to the center of > the whle page (including anything past the scrollbar) - example of the > viewport is 600px high and the whole page is 1000px high it will > scroll so 500px is the middle of the screen as the use sees it.... > > But, this is annoying if the error was generated from an action at the > top of the page as it scrolls down 500px to show the error - making > the user effectvely scroll back up!... > > It would be great if my function was aware of the user's position on > the page - the only problem is ... the function is only passed a > string to disply in the error at present so i have no reference to see > its offsets on the page to work this stuff out.. so i was wondering if > it can be done without passing an element into the funciton to work it > out!.. > > Regards > Alex --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to prototype-scriptaculous+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---