Skip to content

Instantly share code, notes, and snippets.

@Kimmich-DigitalMedia
Created September 5, 2011 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kimmich-DigitalMedia/1196006 to your computer and use it in GitHub Desktop.
Save Kimmich-DigitalMedia/1196006 to your computer and use it in GitHub Desktop.
var s = new Control.Slider('thumb','track', {axis:'vertical'}); //ID's für die beiden Elemente Griff und Seitenleiste
var f = function(value){
var inner = $('innerDiv'); //ändere innerDiv zu dem Namen, den die Textbox hat oder benenne diese innerDiv.
var h = (inner.getHeight() - inner.up('div').getHeight());
inner.style.top = (Math.round(value * h) * -1) + 'px';
}
s.options.onChange = function(value){
f(value);
};
s.options.onSlide = function(value){
f(value);
};
$('plus').observe(
'click',
function(evt){
s.setValue(s.value < 1 ? s.value + 0.1 : 1); //plus und minus sind die ID's der nach oben unten Buttons
}
);
$('minus').observe(
'click',
function(evt){
s.setValue(s.value > 0 ? s.value - 0.1 : 0);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment