I have a script when there is a toggle that make a div hide or show, using the .hide and .show I need to make another script when there is an if statement that happens only when the div is shown.
this is the script:
<script type="text/javascript">
$(document).ready(function() {
$('#click1').toggle(function(){
$('#div1').show().animate({'height': '50%'}, 400);
}, function(){
$('#div1').animate({'height': '0px'}, 400).hide(0);
});
});
</script>
I need to add an if statment like this:
<script type="text/javascript">
$(document).ready(function() {
$('#click1').toggle(function(){
if (div2==show)
{
$('#div2').animate({'height': '0px'}, 400).hide(0);
}
$('#div1').show().animate({'height': '50%'}, 400);
}, function(){
$('#div1').animate({'height': '0px'}, 400).hide(0);
});
});
</script>
thanks