webかたつむり ウェブデザインを勉強中 ウェブ初心者のおぼえがき

webかたつむり

WEB制作会社のフォトグラファー

.animate(); 2

  • width; 300px height; 300px の色の異なる正方形を3つ非表示から各々、即座に表示、スローで表示、5秒かけて表示させる。

html

<!doctype html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<style>
.box{
display: none;
width: 300px;
height: 300px;
line-height: 300px;
text-align: center;
color: white;
border: 4px solid white;
box-sizing: border-box;
}
.box1{ background: #C7A747;}
.box2{ background: #4747C7;}
.box3{ background: #C7474A;}
</style>
<script src="js/jquery-2.2.3.min.js"></script>
<script>
$(function(){
$('.box1').show(),
$('.box2').show('slow'),
$('.box3').show(5000);ms(ミリセカンド)にはクオーテーション不要
});
</script>
</head>
<body>
<div id="container">
<div class="box box1">box1</div>
<div class="box box2">box2</div>
<div class="box box3">box3</div>
</div><!--container-->
</body>
</html>