J’ai un séparateur qui fonctionne bien. Maintenant, le client veut changer le séparateur de la vue horizontale à la vue verticale. Je veux dire que le séparateur est d’abord divisé int dans les 2 divs horizontalement et lorsque je clique sur le bouton, il changera pour diviser les mêmes 2 divs verticalement.
J’ai essayé ça
$(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" }); }); }); #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; } This is the left side of the vertical splitter.
This is the right side of the vertical splitter.
je trouve enfin la solution de ma nouvelle question. Je le conçois en asp.net, donc je fournis la solution en jquery avec asp.net
enter code here
#LeftPane {background: #def; débordement: auto; largeur: 200px; largeur minimale: 50 px; }
#RightPane { background: #def; overflow: auto; min-width: 100px; }
#MySplitter .vsplitbar {width: 8px; curseur: e-redimensionner; curseur: col-redimensionner; couleur de fond: noir; }
#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; } #MySplitter .hsplitbar { height: 2px; background: #487BA4; } #MySplitter .hsplitbar.active, #MySplitter .hsplitbar:hover { background: #487BA4; }
Le code derrière pour le bouton est comme suit
protected void Page_Load(object sender, EventArgs e) { if (HiddenField1.Value == "2") { HiddenField1.Value = "1"; } else { HiddenField1.Value = "2"; } }