problem load() event !

problem load() event !

Hello,

My code :

- index.php
  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3.     $("#centre_contenu").hide();
  4.     $("#loader").show();
  5.     $("#centre_contenu").load("gestion_page.php", function(data) {
  6.         $("#loader").fadeOut('fast', function() {
  7.             $("#centre_contenu").fadeIn(1000);
  8.         });
  9.     });
  10. });
  11. </script>
  12. <div id="centre">
  13.       <span id="loader"><img src="images/loader.gif" border="0" alt="Loading" title="Loading" /> Loading in progress</span>
  14.     <div id="centre_contenu"></div>
  15.   </div>
- gestion_page.php :
  1. <div id="actus_droite">
  2.     <div class="form_ajout_actu"></div>
  3. </div>
  4. <script type="text/javascript">
  5. $(document).ready(function(){
  6.       alert($('.form_ajout_actu').offset().top);
  7. });
  8. </script>
My problem :
offset () evaluates the actual position of the element too early.
The alert returns 0 when it should return a value of about 250!

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3.     $("#centre_contenu").hide();
  4.     $("#loader").show();
  5.     $("#centre_contenu").load("gestion_page.php", function(data) {
  6.         $("#loader").fadeOut('fast', function() {
  7.             $("#centre_contenu").fadeIn(1000);
  8.             alert($('.form_ajout_actu').offset().top);
  9.         });
  10.     });
  11. });
  12. </script>

The alert returns the correct value.
How to work around this problem?
Ideas?


Thank you in advance for your help.