View Single Post
Old 05-31-2009, 11:39 AM   PM User | #1
lauthiamkok
Regular Coder

 
Join Date: Dec 2008
Posts: 117
Thanks: 14
Thanked 0 Times in 0 Posts
lauthiamkok is an unknown quantity at this point
jQuery ajax: Load and fadeIn

Hi,
This is an external html (external.html) I want to load into a page with ajax,

Code:
<div id="wrapper"> 
   <div id="contents">
     xxx
   </div>
</div>
This is the parent page,

Code:
<div>
    <ul>
        <li><a href="#" onclick="ajax_request(); return false;">1</a></li>
    </ul>
</div>

<div class="bottom" id="studies">
</div>
This is the ajax call which I am using Jquery,

Code:
function ajax_request() {
  $('#studies').html('<p>loading</p>');
  $('#studies').load("external.html");
  $("#contents").fadeIn(700);
}
I can load the external.html successfully, but I am not able to fade in the div with the id of 'contents' because it is inside the external.html

How do I get around to it?

Many thanks,
Lau
lauthiamkok is offline   Reply With Quote