jQuery: The Write Less, Do More JavaScript Library

Slider

View: New views
5 Messages — Rating Filter:   Alert me  

Slider

by Luh Hooo Zer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have 3 sliders on one page.

the value combination of slider1 and slider2 dictates the position of
slider3 handle.

but its not smooth... for instance, slider 1 and slider2 have 30
steps, so is pretty smooth to slide, but slider 3 i can only site to
position at values 10, 20, 30.... it doesnt slide like slider1 and
slider2 do....

is there a way to say, as the sliders are sliding, to move slider3
just as smooth ast the other two?


Re: Slider

by Lance May :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Luh Hooo Zer,
     Have you thought about making all of the sliders a 1:100 range
and treating their current step as a percentage of your minimum and
maximum values? That way everything will "slide" through each step the
same, but you will be able to vary your ranges separately without
effecting the general presentation. E.g. instead of...

var value1 = $("#slider1").slider("option", "value");

... try something akin to...

var max1 = 30;
var value1 = (($("#slider1").slider("option", "value") / max1) *
100));

I hope that helps.

On Nov 2, 2:24 pm, Luh Hooo Zer <anthonynori...@...> wrote:

> I have 3 sliders on one page.
>
> the value combination of slider1 and slider2 dictates the position of
> slider3 handle.
>
> but its not smooth... for instance, slider 1 and slider2 have 30
> steps, so is pretty smooth to slide, but slider 3 i can only site to
> position at values 10, 20, 30.... it doesnt slide like slider1 and
> slider2 do....
>
> is there a way to say, as the sliders are sliding, to move slider3
> just as smooth ast the other two?

Re: Slider

by Richard D. Worth-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Are you adding slider1 and slider2 to get the value of slider3? In that case, why does it step at 10, 20, 30? Or perhaps you're multiplying them. Not sure since you say "the value combination."

Are you wanting to animate smoothly between each step even though it can't sit at any value between them?

- Richard

On Mon, Nov 2, 2009 at 1:24 PM, Luh Hooo Zer <anthonynoriega@...> wrote:
I have 3 sliders on one page.

the value combination of slider1 and slider2 dictates the position of
slider3 handle.

but its not smooth... for instance, slider 1 and slider2 have 30
steps, so is pretty smooth to slide, but slider 3 i can only site to
position at values 10, 20, 30.... it doesnt slide like slider1 and
slider2 do....

is there a way to say, as the sliders are sliding, to move slider3
just as smooth ast the other two?



Re: Slider

by Luh Hooo Zer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Well i guess the word value was not the right word.

i have a graphic under the slider1 slider2 and slider3 that says:
Low-----Medium-----High

with 30 steps in the slider.

if a visitor drags slider1 handle to Medium, and slider2 handle to Low

then slider 3 moves to High for instance.

but the way i have it programmed, slider 3 just jumps to value 30 or
"high" when those slider1 and slider2 fit those values.

here is the code:

if (parseInt(slider1Value) >= 11 && parseInt(slider1Value) <=20 &&
parseInt(slider2Value) >= 1 && parseInt(slider2Value) <=10) {
        $("#slider3").slider('option', 'value', 30);
        $('#infoMedPrem').hide();
        $('#infoLowPrem').hide();
        $('#infoHighPrem').show();
}

so as you can see once the sliders fit into those two ranges, the
slider3 jumps to that position... and i just cant logically think of
how to make it slide, as the other two sliders are moving.... i think
that made sense?!?



On Nov 2, 1:28 pm, "Richard D. Worth" <rdwo...@...> wrote:

> Are you adding slider1 and slider2 to get the value of slider3? In that
> case, why does it step at 10, 20, 30? Or perhaps you're multiplying them.
> Not sure since you say "the value combination."
>
> Are you wanting to animate smoothly between each step even though it can't
> sit at any value between them?
>
> - Richard
>
> On Mon, Nov 2, 2009 at 1:24 PM, Luh Hooo Zer <anthonynori...@...>wrote:
>
>
>
> > I have 3 sliders on one page.
>
> > the value combination of slider1 and slider2 dictates the position of
> > slider3 handle.
>
> > but its not smooth... for instance, slider 1 and slider2 have 30
> > steps, so is pretty smooth to slide, but slider 3 i can only site to
> > position at values 10, 20, 30.... it doesnt slide like slider1 and
> > slider2 do....
>
> > is there a way to say, as the sliders are sliding, to move slider3
> > just as smooth ast the other two?- Hide quoted text -
>
> - Show quoted text -

Re: Re: Slider

by Richard D. Worth-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Tue, Nov 3, 2009 at 12:50 PM, Luh Hooo Zer <anthonynoriega@...> wrote:
Well i guess the word value was not the right word.

i have a graphic under the slider1 slider2 and slider3 that says:
Low-----Medium-----High

with 30 steps in the slider.

if a visitor drags slider1 handle to Medium, and slider2 handle to Low

then slider 3 moves to High for instance.

Why? You've yet to state your algorithm or mathematical formula for determining the position of slider3 based on the positions of slider1 and slider2.
 

but the way i have it programmed, slider 3 just jumps to value 30 or
"high" when those slider1 and slider2 fit those values.

here is the code:

if (parseInt(slider1Value) >= 11 && parseInt(slider1Value) <=20 &&
parseInt(slider2Value) >= 1 && parseInt(slider2Value) <=10) {
       $("#slider3").slider('option', 'value', 30);
       $('#infoMedPrem').hide();
       $('#infoLowPrem').hide();
       $('#infoHighPrem').show();
}

so as you can see once the sliders fit into those two ranges, the
slider3 jumps to that position... and i just cant logically think of
how to make it slide, as the other two sliders are moving.... i think
that made sense?!?

I'm afraid I still don't understand the relationship you're trying to set up between these three sliders, but I'll give you an example that may help. I've created two sliders, A and B, whose values are added to determine the value of C:



- Richard
 



On Nov 2, 1:28 pm, "Richard D. Worth" <rdwo...@...> wrote:
> Are you adding slider1 and slider2 to get the value of slider3? In that
> case, why does it step at 10, 20, 30? Or perhaps you're multiplying them.
> Not sure since you say "the value combination."
>
> Are you wanting to animate smoothly between each step even though it can't
> sit at any value between them?
>
> - Richard
>
> On Mon, Nov 2, 2009 at 1:24 PM, Luh Hooo Zer <anthonynori...@...>wrote:
>
>
>
> > I have 3 sliders on one page.
>
> > the value combination of slider1 and slider2 dictates the position of
> > slider3 handle.
>
> > but its not smooth... for instance, slider 1 and slider2 have 30
> > steps, so is pretty smooth to slide, but slider 3 i can only site to
> > position at values 10, 20, 30.... it doesnt slide like slider1 and
> > slider2 do....
>
> > is there a way to say, as the sliders are sliding, to move slider3
> > just as smooth ast the other two?- Hide quoted text -
>
> - Show quoted text -