I presume there is an array holding stop value pixel positions for the slider to allow the handle to lock to each stop. Might anyone know what the array is and how I can access it on the page where the slider resides. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Use the example from here: http://wiki.script.aculo.us/scriptaculous/show/SliderDemo View the source. The function is at the bottom of the page. v = the value On Aug 1, 3:26 pm, xziler8 <gochinm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I presume there is an array holding stop value pixel positions for the > slider to allow the handle to lock to each stop. > > Might anyone know what the array is and how I can access it on the > page where the slider resides.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
I''m aware that v holds the stop value, but I am looking for the pixel (from the left) on the track that represents the horizontal center of the handle. As the handle moves it snaps to a pixel position; there must be an array holding those values for a given slider object. -- X On Aug 1, 4:13 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Use the example from here: > > http://wiki.script.aculo.us/scriptaculous/show/SliderDemo > > View the source. The function is at the bottom of the page. v = the > value > > On Aug 1, 3:26 pm, xziler8 <gochinm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I presume there is an array holding stop value pixel positions for the > > slider to allow the handle to lock to each stop. > > > Might anyone know what the array is and how I can access it on the > > page where the slider resides.- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
You could just calculate it based on the size of the slider and the position. Alternately you could read back the position of the handle for its style. On Aug 7, 3:06 pm, xziler8 <gochinm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m aware that v holds the stop value, but I am looking for the pixel > (from the left) on the track that represents the horizontal center of > the handle. As the handle moves it snaps to a pixel position; there > must be an array holding those values for a given slider object. > > -- X > > On Aug 1, 4:13 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Use the example from here: > > >http://wiki.script.aculo.us/scriptaculous/show/SliderDemo > > > View the source. The function is at the bottom of the page. v = the > > value > > > On Aug 1, 3:26 pm, xziler8 <gochinm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > I presume there is an array holding stop value pixel positions for the > > > slider to allow the handle to lock to each stop. > > > > Might anyone know what the array is and how I can access it on the > > > page where the slider resides.- Hide quoted text - > > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Diodeus..... neither of those will work for the following reasons.
1. If I take the width of the slider minus the width of the handle and
divide by the number of stop values, the result will usually be value
with a decimal which a style distance cannot be set to. If that number
is rounded then you experience variances in the tick marks causing
gross misalignment with the slider handle.
2. If I read back the position of the handle for its style then the
tick mark will not be drawn until the slider moves over the spot.
After-the-fact tick marks are of no value to the user.
Here is the answer to my quandry....
I figured that handle''s stop positions had to be held by the object or
at least calculated on the fly as the onDrag event is fired. So, after
dissecting the code--I learned that if you pass the stop value (* from
the allowedValues array) in a loop and pass each value to the
translateToPx function; the value returned is the distance from the
left end of the slider. So I put each tick mark in an absolutely
positioned layer with the left value set to the offset
offsetX <obj>.translateToPx(<obj>.allowedValues[m]);
// m is the loop
index
Thanks for help during this learning process.
X
On Aug 13, 10:02 am, Diodeus
<diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> You could just calculate it based on the size of the slider and the
> position.
>
> Alternately you could read back the position of the handle for its
> style.
>
> On Aug 7, 3:06 pm, xziler8
<gochinm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>
> > I''m aware that v holds the stop value, but I am looking for
the pixel
> > (from the left) on the track that represents the horizontal center of
> > the handle. As the handle moves it snaps to a pixel position; there
> > must be an array holding those values for a given slider object.
>
> > -- X
>
> > On Aug 1, 4:13 pm, Diodeus
<diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Use the example from here:
>
> > >http://wiki.script.aculo.us/scriptaculous/show/SliderDemo
>
> > > View the source. The function is at the bottom of the page. v =
the
> > > value
>
> > > On Aug 1, 3:26 pm, xziler8
<gochinm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > > I presume there is an array holding stop value pixel
positions for the
> > > > slider to allow the handle to lock to each stop.
>
> > > > Might anyone know what the array is and how I can access it
on the
> > > > page where the slider resides.- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---