Sorry...missed my morning coffee :(

Posted the wrong code.... But I got it with this:

$('a.profile_data').click(function(){
        var x_url = $(this).attr('href');
        $('#content').append('<div id="load"></div>');
        $('#loadHere').fadeOut('fast', function(){
                $('#load').fadeIn('normal');
                $('#loadHere').load(x_url, function(){
        $('#load').fadeOut('normal' , function() { $('#load').remove(); });
                        $('#loadHere').fadeIn('fast');
                        _ajaxInit();
                        });
                });
        return false;
        }); 


Dave
-----Original Message-----
From: amuhlou [mailto:amysch...@gmail.com] 
Sent: August-06-09 10:56 AM
To: jQuery (English)
Subject: [jQuery] Re: Remove help


where is the click function in your javascript? I don't see it in the
snippet you posted.

it may work better to fade out the loading div as a callback to your load
method:

$('#content').load('/<?php echo $url ; ?>/profile/', function(){
   $('#load').fadeOut().remove();
});


On Aug 6, 9:17 am, "Dave Maharaj :: WidePixels.com"
<d...@widepixels.com> wrote:
> I have append to add a loading div. But once loaded i want to fade it 
> out and remove it.
>
> I have:
> <script type= "text/javascript">/*<![CDATA[*/ 
> $(document).ready(function(){
>  $('#content').append('<div id="load"></div>');
>  $('#load').fadeIn('normal');
>  $('#content').load('/<?php echo $url ; ?>/profile/');
>  $('#load').fadeOut('normal' , function() { $('#load').remove(); });
>
> });
>
> </script>
>
> But it does not remove the #load div...so looking at firebug the load 
> div gets added everytime a user clicks a link
>
> <div id="load" style="display: none;"/> <div id="load"/> <div 
> id="load"/> <div id="load"/> <div id="load"/>
>
> How can I remove the div once it done loading?
>
> Dave

Reply via email to