*anna* 4 years ago
parent c4cda29984
commit 982be57eca

@ -1,35 +0,0 @@
div.figure1 {
position:absolute;
left: 15%;
top: 15%;
}
div.figure2 {
position:absolute;
left: 70%;
top: 30%;
}
div.figure3 {
position:absolute;
right: 10%;
top: 75%;
}
div.figure4 {
position:absolute;
left: 50%;
top: 50%;
}
div.figure5 {
position:absolute;
left:45%;
top: 10%;
}
div.figure6 {
position:absolute;
left:10%;
bottom: 15%;
}

@ -1,46 +0,0 @@
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>wayfair</title>
<link rel="stylesheet" href="wayfair.css">
</head>
<body>
<div class="figure1">
<img id="forniture1" src="../gifs/forniture_1.gif" style="display: block;">
<img id="child1" src="../gifs/child_6.gif" style="display: none;">
</div>
<div class="figure2">
<img id="forniture2" src="../gifs/forniture_2.gif" style="display: block;">
<img id="child2" src="../gifs/child_2.gif" style="display: none;">
</div>
<div class="figure3">
<img id="forniture3" src="../gifs/forniture_3.gif" style="display: block;">
<img id="child3" src="../gifs/child_3.gif" style="display: none;">
</div>
<div class="figure4">
<img id="forniture4" src="../gifs/forniture_4.gif" style="display: block;">
<img id="child4" src="../gifs/child_4.gif" style="display: none;">
</div>
<div class="figure5">
<img id="forniture5" src="../gifs/forniture_5.gif" style="display: block;">
<img id="child5" src="../gifs/child_5.gif" style="display: none;">
</div>
<div class="figure6">
<img id="forniture6" src="../gifs/forniture_6.gif" style="display: block;">
<img id="child6" src="../gifs/child_1.gif" style="display: none;">
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript" src="wayfair.js" ></script>
</body>

@ -1,39 +0,0 @@
$(document).ready(function() {
$("#forniture1").hover(
function(){ $("#forniture1").hide()},
function(){ $("#child1").show()
});
$("#forniture2").hover(
function(){ $("#forniture2").hide()},
function(){ $("#child2").show()
});
$("#forniture3").hover(
function(){ $("#forniture3").hide()},
function(){ $("#child3").show()
});
$("#forniture4").hover(
function(){ $("#forniture4").hide()},
function(){ $("#child4").show()
});
$("#forniture5").hover(
function(){ $("#forniture5").hide()},
function(){ $("#child5").show()
});
$("#forniture6").hover(
function(){ $("#forniture6").hide()},
function(){ $("#child6").show()
});
});;

@ -7,7 +7,8 @@
</head>
<body>
<div class="score">
score:<div id="result" ></div>
score:<span id="result" >0</span>/6
<div id="win"></div>
</div>
<div class="figure1">
<img id="forniture1" src="../gifs/forniture_1.gif" style="display: block;">

@ -1,12 +1,15 @@
$(document).ready(function() {
var counter = 0;
$("#forniture1").click(function(){
counter ++;
$('#result').html(counter);
$("#forniture1").hide();
$("#child1").show();
winning();
});
$("#forniture2").click(function(){
@ -14,6 +17,7 @@ $(document).ready(function() {
$('#result').html(counter);
$("#forniture2").hide();
$("#child2").show();
winning();
});
$("#forniture3").click(function(){
@ -21,6 +25,7 @@ $(document).ready(function() {
$('#result').html(counter);
$("#forniture3").hide();
$("#child3").show();
winning();
});
$("#forniture4").click(function(){
@ -28,6 +33,7 @@ $(document).ready(function() {
$('#result').html(counter);
$("#forniture4").hide();
$("#child4").show();
winning();
});
$("#forniture5").click(function(){
@ -35,6 +41,7 @@ $(document).ready(function() {
$('#result').html(counter);
$("#forniture5").hide();
$("#child5").show();
winning();
});
$("#forniture6").click(function(){
@ -42,7 +49,30 @@ $(document).ready(function() {
$('#result').html(counter);
$("#forniture6").hide();
$("#child6").show();
winning();
});
function winning() {
if (counter === 6) {
$('#win').html("you won!");
//alert ("you won");
} };
});;
/*(function() {
if (counter === 6) {
//$('#winmessage').html("you won!");
alert ("you won");
} });
if (counter == 1) {
console.log ("you won");
}*/
Loading…
Cancel
Save