[Project_owners] Scrolling a horizontal scrollbox

Didier Ernotte didier at ernotte.com
Thu Jun 2 11:40:35 EDT 2005


No idea about the getPosition about I have a ticker in my extension
http://inforss.mozdev.org . Do you want something similar ?

Didier

--- Brian King <brian at mozdev.org> wrote:

> I have a scrollbox [horizontal] populated with multiple label
> elements.
> I want to flow through it via script, i.e. scroll it at a given
> interval.
> 
> JS looks like this:
> 
>    Scroll : function()
>    {
>      var scrollbox =
> document.getElementById("ticker-bar").childNodes[1];
>      var scrollboxObj =
>
scrollbox.boxObject.QueryInterface(Components.interfaces.nsIScrollBoxObject);
>      var x = {};
>      var y = {};
>      scrollboxObj.getPosition(x, y);
>      dump(y.value + "-" + x.value+"\n");
>      scrollboxObj.scrollTo(0,y.value+10)
>      setTimeout(this.setScrollInterval, 1000);
>    },
> 
> I verified that the scrollbox element is being grabbed correctly, but
> nsIScrollBoxObject.getPosition is always returning {0, 0} on each
> iteration.
> 
> One thing to note is that the scrollbox is part of a XUL template
> which
> generates the labels.
> 
> Any ideas, or alternative ways I could scroll such content?
> 
> -- 
> Brian King
> www.mozdev.org - free project hosting for the Mozilla community
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 



More information about the Project_owners mailing list