Leon Mayne

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromLeon Mayne
ToMe
SubjectSlider wishlist
Date21 September 2004 10:13
Hello,
Thanks for the great sider script, it's helped me no end.
I was wondering though if I could ask for some additions? I am making a form
for a person who needs a few more features:
1) Being able to set the slider start position, and
2) Being able to set the slider as 'disabled' i.e. it displays but the user
can't move the slider.

Would these be relatively easy to implement?


[...and email number 2...]


Sorry, ignore (1), I, being a bit of a dumbass forgot that it already does
this (doh!).
Would it be possible to just include an attribute that will make the sider
disabled though?


[...and email number 3...]


OK, sorry to have bugged you. Don't worry about it as I've found out how to
change it. Thanks again for a great script!
FromMe
ToLeon Mayne
SubjectRe: Thanks for your image autoresizing popup script!
Date21 September 2004 10:55
Leon,

> 1) Being able to set the slider start position

Immediately after creating the slider, call the setPosition method:
var myslider = new slider(
 ...
);
myslider.setPosition(0.5);

> 2) Being able to set the slider as 'disabled'

in the funtions that are called when the slider is moving or stops moving,
use the setPosition method to reset the slider to the last known position
instead of performing the usual processing.

var sliderIsDisabled = true;
var lastKnownPosition = 0.5;

var myslider = new slider(
 ...
);
myslider.setPosition(lastKnownPosition);

function moveFunction(sliderPosition) {
    if( sliderIsDisabled ) {
        myslider.setPosition(lastKnownPosition);
    } else {
        ... do something with sliderPosition ...
    }
}

function moveFunction(sliderPosition) {
    if( sliderIsDisabled ) {
        myslider.setPosition(lastKnownPosition);
        ... maybe warn them that they need to do
             something else to enable the slider ...
    } else {
        lastKnownPosition = sliderPosition;
        ... do something with sliderPosition ...
    }
}

I may add this later as a proper property, but for now, this would work
just as well.

Hope this is useful


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromLeon Mayne
ToMe
SubjectRe: Slider wishlist
Date21 September 2004 11:00
:-)
Thanks for getting back to me quickly, a bit too quick!
Sorry for wasting your time.
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.