Thanks, scrollIntoView did the trick!

Alex Back-2 wrote:
> 
> Hi JD,
> 
> On Friday 04 May 2007 jd102684 wrote:
>> I need to be able to take a scrollable widget and force the scroll bar to
>> go back to the top.
>>
>> say I scroll all the way down.  There is another widget within the first
>> widget that I click to do something, and upon clicking it I want the
>> outer
>> widget to scroll back up to the top.  It seems simple enough, but I can't
>> find any sort of way to do this.  Any help is much appreciated.  Dirty
>> hacks welcome.
> No dirty hack needed :-) 
> Did you tried out the "scrollIntoView" method? Try to call this method at
> the 
> eventlistener code. You should call this method on the widget which should 
> appear in the visible area. Is there another children widget at the top of 
> your parent widget or do you have only one child widget within the parent?
> 
> If there is another child widget at the top of the parent widget this code 
> example code should do the job.
> 
> -- snip --
> parentWidget.addEventListener("click", function(e){
>   // do something
> 
>   // scrolling
>   myFirstChild.scrollIntoView();
> });
> -- snap --
> 
> Hope that helps.
> 
> cheers,
>   Alex
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Forcing-scroll-position-tf3694375.html#a10357827
Sent from the qooxdoo-devel mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to