2012-04-03 2 views
0

현재 이미지가 튀어 나오고 페이지가 튀어 나오지만 스플래시 이미지가 희미 해지면 페이지가 페이드 인합니다.javascript 편집 :이 스크립트에 페이드 인 기능을 추가하십시오.

<html> 
<head> 
    <style type="text/css"> 
     #content { 
      display:none; 
      } 
    </style> 
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> 
    <script type="text/javascript"> 
     $(function(){ 
      setTimeout(function() { 
       $("#splash").fadeOut("slow", function() { 
        $("#content").show(); 
       }); 
      }, 500); 
     }); 
    </script> 
</head> 
<body> 
<div id="splash"> 
    <img src="http://farm1.static.flickr.com/215/482472428_5f2f592b64.jpg" /> 
</div> 
<div id="content"> 
    Content 
</div> 
</body> 
</html> 

답변

0

변경 $("#content").show();

0

$("#content").fadeIn("slow");에 당신이 무슨 뜻 수행


$(document).ready(function() { 
    $("#splash").fadeOut("slow", function() { 
    $("#content").fadeIn(); 
    }); 
}); 
+0

완벽한, 덕분에 당신은 아웃 - 년 jQuery를 사용하는 대신이 링크를 사용! – user1070385

+0

효과가있는 경우 수락으로 표시 할 수 있습니다. –

0

나는 개인적으로 jQuery를 사용할 때마다 문서 준비 함수를 사용합니다.

BTW : http://code.jquery.com/jquery-1.7.2.min.js

이 시도 :

<html> 
<head> 
    <style type="text/css"> 
     #content { 
      display:none; 
      } 
    </style> 
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script> 
    <script type="text/javascript"> 
     $(document).ready(function() { 
      $("#splash").fadeOut("slow"); 
      $("#content").delay(500).fadeIn(); 
     }); 
    </script> 
</head> 
<body> 
<div id="splash"> 
    <img src="http://farm1.static.flickr.com/215/482472428_5f2f592b64.jpg" /> 
</div> 
<div id="content"> 
    Content 
</div> 
</body> 
</html> 
관련 문제