View Full Version : Volume slider on the slide
19th November 2001, 16:04
Is it possible to do a volume slider that is not on the horizontal, say at 45 degrees? I know it is for I have seen the future! The real question is this:
Would it be possible to script it as a thumb slider that travels along the 'volume path' as it were rather than a series of images.
If so, how on earth do you do? I draw pictures, me and am still awaiting a bigger brain for all the scripty stuff :eek:
19th November 2001, 18:30
It's certainly possible to make diagonal sliders. However, you have to do it all with scripting. As in, when you detect the mouseover, you'd have to move the thumb image to the appropriate location. That's a theory BTW. All I've tried are vertical and circular sliders.
20th November 2001, 06:07
All you need is some creative math in the script.
It will probably involve some trig (sin, cos, tan). What you need to do is to represent the hypotenuse of the triangle as the volume, so you have the minimum at the bottom, and the max at the top.
When you get the volume, figure out what percent it is from the maximum, and multiply that by the pixel length of the hypotenuse. Once you have that, all you need are the x and y coordinates at that point. Assuming you are working from the bottom-left angle:
Using just sin and cos, you can get the x and y values for where to place the thumb.
20th November 2001, 15:12
You can use this stupid lib and all you need is 3 png and a few lines of code.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.