I have a splitter that works fine. Now the client wants to change the splitter from horizontal view to vertival view. I mean that the splitter is first split int the 2 divs horizontally and when I click the button it will change so that it's split the same 2 divs vertically.
I tried this
<script type="text/javascript">
$(function () {
$('.LeftPane').attr('id', 'LeftPane');
$('.RightPane').attr('id'`enter code here`, 'RightPane');
$("#MySplitter").splitter({
type: "v"
});
$('#Button1').click(function () {
$('#LeftPane').attr('id', 'TopPane');
$('#RightPane').attr('id', 'BottomPane');
$("#MySplitter").splitter({
type: "h"
});
});
});
</script>
<style type="text/css" media="all">
#MySplitter
{
height: 400px;
width: 600px;
margin: 1em 2em;
background: #def;
border: 2px solid #039; /* No padding allowed */
}
#LeftPane
{
background: #def;
overflow: auto;
width: 200px; /* optional, initial splitbar position */
min-width: 50px;
}
#RightPane
{
background: #def;
overflow: auto;
min-width: 100px; /* No margin or border allowed */
}
#MySplitter .vsplitbar
{
width:8px;
cursor: e-resize; /* in case col-resize isn't supported */
cursor: col-resize;
background-color:Black;
}
#MySplitter .vsplitbar.active, #MySplitter .vsplitbar:hover
{
background-color:Black;
}
#TopPane
{
background: #def;
overflow: auto;
width: 200px;
min-width: 50px; /
}
#BottomPane
{
background: #def;
overflow: auto;
min-width: 100px; /* No margin or border allowed */
}
#MySplitter .hsplitbar
{
height: 2px;
background: #487BA4;
}
#MySplitter .hsplitbar.active, #MySplitter .hsplitbar:hover
{
background: #487BA4;
}
</style>
</head>
<body>
<div id="MySplitter">
<div class="LeftPane">
<p>
This is the left side of the vertical splitter.</p>
</p>
</div>
<div class="RightPane">
This is the right side of the vertical splitter.</p>
</div>
</div>
<p>
<input id="Button1" type="button" value="splitchange" /></p>
</body>
</html>