forked from gmrockman/web-sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gmrockman
committed
Apr 4, 2019
0 parents
commit 6c84e39
Showing
8 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#main { | ||
width: 500px; | ||
margin: 0 auto; | ||
position: relative; | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="ja"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>イメージを表示</title> | ||
<link rel="stylesheet" href="default.css"> | ||
</head> | ||
<body> | ||
<div id="main"> | ||
<h1>今日のイメージ</h1> | ||
<img id="myImage" width="500" height="333" src="images/default.jpg"> | ||
</div> | ||
<script src="./js/sample.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
var images = ["img0.jpg", "img1.jpg", "img2.jpg", | ||
"img3.jpg"]; | ||
// イメージをランダムに取り出す | ||
var tImg = images[Math.floor(Math.random() * 4)]; | ||
// イメージエレメントを取得 | ||
var myImage = document.getElementById("myImage"); | ||
// src属性にイメージを設定 | ||
myImage.src = "images/" + tImg; |