2011-11-28 1 views
0

페이지가 완전히로드 될 때까지 #page에 pre-load.gif가 표시되는 방법을 알고 싶습니다.
이 작업을 수행하는 방법? jQuery 클릭 기능을 사용하여 페이지가 완전히로드 될 때까지 사전로드 애니메이션을 추가하는 방법은 무엇입니까?

$('#target').click(function() { 
    $('#page').html('first page load'); //will be replaced with .load 
}); 

$('#target2').click(function() { 
    $('#page').html('second page load'); //will be replaced with .load 
}); 

는 일 예에 살펴 http://jsfiddle.net/EZj4R/1/

답변

0

jQuery를로드가 아약스를위한 속기, 그리고 docs에 그것은 완전한 기능을 허용 말한다 보시기 바랍니다.

당신은 부하

$('#target').click(function() { 
    $('#page').html('<img src="loading.gif">').load('/some/url/');; 
}); 

Check out this fiddle

를 호출하기 전에 로딩 GIF를 미리로드 할 수
관련 문제