Created
August 5, 2014 03:41
-
-
Save bentinata/9642e6a25b9365a57016 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Decomposition</title> | |
<style> | |
body | |
{ | |
background-color: black; | |
} | |
#Position | |
{ | |
top: 500px; | |
left: 500px; | |
right: 500px; | |
bottom: 500px; | |
position: relative; | |
color: white; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="Position"> | |
<img id="image" src="http://www.rsg-shop.com/images/Ball-PASTORELLI-Giallo-Fluo-00014-0.jpg" width="50px" height="50px"> | |
<p id="text">Yellow!!</p> | |
</div> | |
<div id="Position"> | |
<button onclick="f01()" type="button">Change</button> | |
<button onclick="f02()" type="button">Change Word</button> | |
<button onclick="f03()" type="button">Change Image</button> | |
</div> | |
<script> | |
function f01() | |
{ | |
var img01 = document.getElementById("image").src; | |
var text01 = document.getElementById("text").innerHTML; | |
if (img01.match("rsg-shop")) | |
{ | |
img01 = "http://www.precisionballs.com/solid_works/JPEG/ball.jpg"; | |
text01 = "Blue!!"; | |
} | |
else | |
{ | |
img01 = "http://www.rsg-shop.com/images/Ball-PASTORELLI-Giallo-Fluo-00014-0.jpg"; | |
text01 = "Yellow!!"; | |
} | |
} | |
function f02() | |
{ | |
if (text01.match("Yellow")) | |
{ | |
text01 = "Blue"; | |
} | |
else | |
{ | |
text01 = "Yellow"; | |
} | |
} | |
function f03() | |
{ | |
if (img01.match("rsg-shop")) | |
{ | |
img01 = "http://www.precisionballs.com/solid_works/JPEG/ball.jpg"; | |
} | |
else | |
{ | |
img01 = "http://www.rsg-shop.com/images/Ball-PASTORELLI-Giallo-Fluo-00014-0.jpg"; | |
} | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment