Good day!
I am trying to hide and show divs with slide animation. My code is as follows:
<style>
div.bigBox
{
background-color:white;
width:100px;
height:125px;
overflow:hidden;
}
div.try{
background-color:green;
width:100px;
height:125px;
float: left;
}
div.try2{
background-color:yellow;
width:100px;
height:125px;
}
}
</style>
<script language="JavaScript" src="js/jquery-1.6.1.js"></script>
<script src="http://ui.jquery.com/latest/ui/jquery.effects.core.js"></script>
<script src="http://ui.jquery.com/latest/ui/jquery.effects.slide.js"></script>
</head>
<body>
<div class="bigBox">
<div class="try">
<p id="haha">CLICK THIS</p>
<p>This is a demonstration of jQuery SimpleDialog.</p>
</div>
<div class="try2">
<h3 id="test2">CLICK THIS</h3>
<p>This is a demonstration of jQuery SimpleDialog.</p>
</div>
</div>
<script>
$('#haha').click(function () {
alert("test");
$('.try').hide("slide", { direction: "left" }, 1000);
$('.try2').show("slide", { direction: "right" }, 1000);
});
</script>
The problem is the transition of one box to another. It doesn't flow very smoothly. I want to hide and at the same time show (like tailing the box to be hidden). Please help. Thanks