開発環境
- OS X Yosemite - Apple (OS)
- Safari, Firefox, Google Chrome(Webプラウザ)
- Emacs (CUI)、BBEdit - Bare Bones Software, Inc. (GUI) (Text Editor)
- JavaScript (プログラミング言語)
Head First jQuery(Ryan Benedetti(著)、Ronan Cranley(著)、O'Reilly Media)のChapter 2(Selectors and Methods: Grab and Go)、SHARPEN YOUR PENCIL(No. 1018)を解いてみる。
その他参考書籍
SHARPEN YOUR PENCIL(No. 1018)
HTML5(BBEdit, Emacs)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Jump for Joy</title>
<link rel="stylesheet" href="sample1018.css">
</head>
<body>
<header>
<h2>Jump for Joy Sale</h2>
</header>
<section id="main">
<div class="guess_box"><img src="images/jump1.jpg" alt="jump1"></div>
<div class="guess_box"><img src="images/jump2.jpg" alt="jump2"></div>
<div class="guess_box"><img src="images/jump3.jpg" alt="jump3"></div>
<div class="guess_box"><img src="images/jump4.jpg" alt="jump4"></div> </section>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
$(document).ready(function (){
$('.guess_box').click(function() {
alert('You clicked me.');
});
});
</script>
</body>
</html>
CSS
header, section, div{
float:left;
height:245px;
text-align:left;
border: solid #000 3px;
}
header{
width:100%;
border:0px;
height:50px;
}
#main{
background-color:grey;
height: 500px;
}
.guess_box {
height: 245px;
}
0 コメント:
コメントを投稿