CSSトランジション はあなたが探しているものです、
これは、画像のフェード効果を表示する素晴らしいデモです:http: //cssnerd.com/2012/04/03/jquery-like-pure-css3-image-fade-in/
ここにいくつかのデモコードがあります:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>
<script src="jquery.js"></script>
<script>
$(document).ready(function() {
var change = true;
$('#ba').click(function() {
if(change) {
$('#a').css('opacity', ' 0');
$('#b').css('opacity', '1');
} else {
$('#a').css('opacity', '1');
$('#b').css('opacity', '0');
}
change = !change;
});
});
</script>
<style>
.fadeeffect {
-webkit-transition: opacity 250ms ease-in-out;
-moz-transition: opacity 250ms ease-in-out;
-o-transition: opacity 250ms ease-in-out;
transition: opacity 250ms ease-in-out;
}
</style>
</head>
<body>
<button type="button" id="ba" >
Click Me!
</button>
<div>
<p id="a"class="fadeeffect">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<p id="b" class="fadeeffect">
eafdsaf dsa dgsf dgadg dfg dagfadgLorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
</div>
</body>
</html>