I try to allow the icons (which will be buttons in the future) to remain hidden until the correct word is placed on the tab in which the button is located, so when all this is done, you can click on the icon, I set the correct word to right tab, and some sounds will play. But I canβt understand how to allow the icon to remain hidden until the word is placed, if I look at it, something needs to be hidden until the button is pressed, but I do not want this ..
Here is what it looks like

This is my code.
$(document).ready(function() { var rigtige = 0;
body, html { margin-left: 10%; margin-right: 10%; padding: 0px; height: 100%; font-family: georgia, "Comic Sans MS"; background-color: #f0f0f0; } .container { height: 90%; border-collapse: collapse; display: table; } .igen { font-size: 25px; font-weight: bold; } .points { float: right; } .container { height: 90%; border-collapse: collapse; display: table; } header { height: 5%; border-bottom: thick solid grey; } .img { width: 25%; height: 30%; background-color: #f0f0f0; float: left; } .center { margin-left: 25%; margin-right: 25%; } .antwoord { float: left; width: 95%; height: 25px; background-color: white; border-style: solid; border-color: #000000; border-width: 4px; } .move2 { margin-top: 12.5% } .move4 { margin-top: 19% } .move5 { margin-top: 33.5% } .move6 { margin-top: 20.8% } .move7 { margin-top: 37.5% } .border { margin-top: 45%; border-top: thick solid grey; background-color: red; } .word, .word .tekst, .word p { display: inline; margin-left: 7%; font-weight: bold; } .my-row { clear: both; } .answers .word, .answers .word2 { float: left; padding: 3px; margin-left: 7%; font-weight: bold; } .fa { margin-left: 5px; margin-top: 2px; } .word, .word2 { padding-top: 5%; margin: 5%; } footer { border-top: thick solid grey; height: 5%; display: table-row; vertical-align: bottom; } .sprint { float: right; } .copyright { position: relative; bottom: 20px; left: 65px; font-size: 10px; } a { text-decoration: none; color: black; } a:hover { text-decoration: none; color: black; }
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Words</title> <link rel="stylesheet" href="style.css" media="screen" title="no title" charset="utf-8"> <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> </head> <body> <header> <a href=""><span class="fa fa-refresh spin" style="font-size:25px;"></span><span class="igen spin"> igen</span></a> <span class="points"><i class="fa fa-thumbs-o-up" style="font-size:24px"></i>Rigtige: <span id="rigtige">0</span> <i class="fa fa-thumbs-o-down" style="font-size:24px"></i>Forkerte: <span id="forkerte">0</span> </span> </header> <div class="container"> <div class="img" id="img1"> <div class="plaatje" id="plaatje1"> <img class="center" src="img/cat.jpg" alt="cat" width="50%;"> </div> <div class="move1"> <div class="antwoord droppable" id="antwoord1"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img2"> <div class="plaatje" id="plaatje1"> <img class="center" src="img/beak.jpg" alt="beak" width="50%;"> </div> <div class="move2"> <div class="antwoord" id="antwoord2"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img3"> <div class="plaatje" id="plaatje3"> <img class="center" src="img/spoon.jpg" alt="spoon" width="50%;"> </div> <div class="move3"> <div class="antwoord" id="antwoord3"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img4"> <div class="plaatje" id="plaatje4"> <img class="center" src="img/milk.jpg" alt="milk" width="50%;"> </div> <div class="move4"> <div class="antwoord" id="antwoord4"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img5"> <div class="plaatje" id="plaatje5"> <img class="center" src="img/egg.jpg" alt="egg" width="50%;"> </div> <div class="move5"> <div class="antwoord" id="antwoord5"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img6"> <div class="plaatje" id="plaatje6"> <img class="center" src="img/thee.jpg" alt="tea" width="50%;"> </div> <div class="move6"> <div class="antwoord" id="antwoord6"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img7"> <div class="plaatje" id="plaatje7"> <img class="center" src="img/meel.jpg" alt="flour" width="50%;"> </div> <div class="move7"> <div class="antwoord" id="antwoord7"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="img" id="img8"> <div class="plaatje" id="plaatje8"> <img class="center" src="img/passport.jpg" alt="passport" width="50%;"> </div> <div class="move8"> <div class="antwoord" id="antwoord8"><i class="fa fa-play" style="font-size:20px"></i> </div> </div> </div> <div class="answers"> <div class="my-row border"> <div class="word" id="word0"></div> <div class="word" id="word1"></div> <div class="word" id="word2"></div> <div class="word" id="word3"></div> </div> <div class="my-row"> <div class="word2" id="word4"></div> <div class="word2" id="word5"></div> <div class="word2" id="word6"></div> <div class="word2" id="word7"></div> </div> </div> <footer> <img class="dansk" id="dansk" src="img/dansk2.jpg" alt="dansk" /> <img class="sprint" id="sprint" src="img/sprint2.png" alt="sprint" /> <center><span class="copyright"> ©2013 laerdansk / FC-Sprint² Leerbedrijf bronnen </span> </center> </footer> <script type="text/javascript"> var jsonData = "noJson"; var hr = new XMLHttpRequest(); hr.open("GET", "json_files/jsonData_0_123.json", true); hr.setRequestHeader("Content-type", "application/json", true); hr.onreadystatechange = function() { if (hr.readyState == 4 && hr.status == 200) { jsonData = JSON.parse(hr.responseText).main_object; } } hr.send(null); </script> <script src="javascript.js"></script> </body> </html>
This is my violin, I hope that everything is in order, as this is the second time, doing the violin if it is not, please, tips are always welcome! https://jsfiddle.net/82332Lk8/
source share