jquery call back function
<p>I have a call back function as follows</p>

<pre><code>$('#lnkClientData').click(function() {


        $('#clientdiv').slideToggle(function(){
            if($('#lnkClientData').hasClass('open'))
            {

                $('#divnext').slideToggle();
                $('#lnkClientData').removeClass('open').addClass('close');
            }
            else
            {

             $('#divnext').slideToggle();
             $('#lnkClientData').removeClass('close').addClass('open');
            }
        }
        );
     });
</code></pre>

<p>I want the  <code>$('#divnext').slideToggle();</code> code to be executed before the outside  <code>$('#clientdiv').slideToggle()</code> function....
Right now the outside function gets called first....what I am trying to do is hide an anchor when a <code>div</code> slides in...but his happens before the <code>div</code> slides in...</p>

<pre><code>  if($('#clientDiv').is(':visible'))
             {
             alert('');
               //  $('#divnext').hide();
                 //$('#clientDiv').slideToggle(); // Or whatever animation you want
             }
             else
             {
                 //$('#clientDiv').slideToggle(function() // Or whatever animation   you   want
                 //{
                   //  $('#divnext').show();
                 //});
             }
</code></pre>
