window.scrollTo for WebOS / Palm Pre

without comments

As WebOS wraps the app content inside a scene/stage structure, scrolling does not work like in other widget runtimes, as you can see here.

So, how to manipulate the scrolling position using Javascript?

Simple, you search for #mojo-scene-main-scene-scroller and set its scrollTop/Left position.

var scroller = document.getElementById("mojo-scene-main-scene-scroller");
if (scroller) {
	scroller.scrollTop = y;
}

Written by admin

March 29th, 2010 at 12:54 pm

Posted in Code

Tagged with , ,

Leave a Reply