나는 웹 프로그래밍 세계에 조금은 초보자이지만 사진의 흑백 버전에서 일반 컬러 버전으로 전환 할 웹 페이지를 개발하려고합니다. 페이지가로드 될 때 사진.전환 배경 이미지
여러 가지 시도를 한 후에 가장 좋은 방법은 컬러 버전을 즉시 표시하는 것입니다. 또한 JQuery로 약간 놀아 보려고했지만 어떤 이유로 페이지를 올바르게로드 할 수 없습니다. 일반 버전으로 전환하는 대신 흑백 버전을 유지했습니다. 다음과 같이
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="index.css">
<link href='http://fonts.googleapis.com/css?family=Bad+Script' rel='stylesheet' type='text/css'>
<title>UCLA Wushu - Home</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("html").animate({'background' : 'url(images/home_background.jpg) no-repeat center center fixed'}, 'slow');
});
</script>
</head>
<body>
<div id="container">
<div id="middleBar">
<strong>
<a href="index.html">My Portal</a>
</strong>
<div id="enter"><a href="announcements.html">Enter</a></div>
</div>
</div>
</body>
</html>
관련 CSS는 (필자는 브라우저에 효과적으로 배경 이미지를 스트레칭하기 위해 복사 및 붙여 넣기)입니다 :
@charset "UTF-8";
/* CSS Document */
html {
background: url(images/home_background_bw.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
주시기 바랍니다 다음과 같이
html로는 이 형식을 사용하여 흑백에서 컬러로 부드럽게 전환 할 수있는 방법이 있는지 알고 있습니다. 감사합니다 :)