Tuesday, November 14th, 2006
Dojo Smooth Scrolling
There have been requests for smooth scrolling widgets in Dojo, and Heng Liu stood up tot he plate by implementing dojo.lfx.smoothScroll.
Along with this new dojo.lfx resource, other improvements include:
dojo.html.getAbsolutePositionis extended to be compatible withdojo.withGlobal- a new function,
dojo.html.getAbsolutePositionExtis introduced in resourcedojo.html.utilto include support for getting abosolute postion of a node in iframes with regards to a given window. The reason why this is not merged intodojo.html.getAbsolutePositionis that, this new feature depends on APIs defined indojo.html.util. In order to avoid introducing it as a dependency indojo.html.layout, this design decision is made.
To see it in action check out this test page and click on the buttons on the top left to see the items scroll.
Example Usage
-
-
dojo.event.connect(dojo.byId("goToHeader0"), "onclick", function (e) {
-
var h2s = dojo.html.iframeContentDocument(dojo.byId("embed0")).getElementsByTagName('h2');
-
var h2 = h2s[h2s.length-1];
-
var anm = new dojo.lfx.smoothScroll(h2,dojo.html.iframeContentWindow(dojo.byId("embed0")),null,500);
-
anm.play();
-
});
-
The entire thing is pretty small, take a peek for yourself












Dojo Smooth Scrolling
This is pretty cool, but it’s pretty easy to implement with jQuery or any other Frameworks out there.
http://archive.dojotoolkit.org/nightly/tests/lfx/test_scroll.html
…
[...] Ajaxian » Dojo (tags: Development_Ajax_Dojo) [...]
Hmmm… I’m a bit confused by all the red text which says ‘This should be green’.
Is that a problem or just to make people like me confused?!