Stating with a well know vertical slitter based on query resizable widget, I have tried to make it into a horizontal Splitter. However Something is wrong and I really can´t see what it is. It´s probably just something I overlooked, but help is needed.
I would think the orientation of the Splitter were given by the resizable function, but the handle is still vertical. Here´s the function:
$(function ()
{
$(".resizable1").resizable(
{
autoHide: true,
handles: 'e',
resize: function(e, ui)
{
var parent = ui.element.parent();
var remainingSpace = parent.height() - ui.element.outerHeight(),
divTwo = ui.element.next(),
divTwoHeight = (remainingSpace - (divTwo.outerHeight() - divTwo.height()))/parent.height()*100+"%";
divTwo.height(divTwoHeight);
},
stop: function(e, ui)
{
var parent = ui.element.parent();
ui.element.css(
{
height: ui.element.height()/parent.height()*100+"%",
});
}
});
});
Here´s the fiddle: http://jsfiddle.net/nsjYs/