To display the slider control vertically and align the items so that they are visually displayed in the middle (css: vertical-alignment: center) of the item.
Implementation:
When changing the orientation of the slider control to vertical it is not possible to properly line-up the labels of each item in the slider. To work around this limitation I have created a little bit of javascript which changes the top position of the <span> tags that are used to display the caption for each item as follows:
function
applyVerticalSliderFix(sliderId)
{
var labels = $get(sliderId).getElementsByTagName('span');
for(i=0; i<labels.length; i++)
{
var label = labels[i];
var topOffset = Math.floor((label.parentNode.clientHeight - label.clientHeight) / 2);
label.style.top = topOffset + 'px';
}
}
For the above to work I created a new skin where the ".rslItem SPAN" definition uses a "position:absolute" for the top style attribute to have any effect.
Problem:
The above solution seems to work in IE and FF but every now and then throws off the location of the draghandle by a couple of pixels (10 - 15 pixels). In which case the draghandle is no longer properly lined up.
Any suggestions are much appreciated.
Regards, Elmar