Slide toggle from right-to-left and left-to-right.
This is the version #1 of the DEMO
HTML
<div id="body">
<h2>Slide toggle from right to left.</h2>
<hr/>
<p>
<button id="button" class="myButton">Run Effect</button>
</p>
<div id="myDiv">
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</div>
<div class="other_details">This should move parallely with resize of div being toggled.</div>
</div>
CSS
#myDiv {
color:Green;
background-color:#eee;
border:2px solid #333;
text-align:justify;
float:left;
width:200px;
}
.other_details{
float:left;
font-weight:bold;
width:200px;
border:1px solid black;
padding:5px;
margin-left:2px;
}
JavaScript
$(".myButton").click(function () {
var effect = 'slide';
var duration = 500;
$('#myDiv').toggle(effect, {direction: "left"}, duration);
});