Created
September 5, 2011 21:54
-
-
Save Kimmich-DigitalMedia/1196006 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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