JSFiddle - React, Tailwind, and code Playground
by rafalry
HTML
<div type="content">
<h4>Zachętka</h4>
<div type="content" id="postac" class="postac" onclick="pokazZachetke();"></div>
<div type="content" id="zachetka" class="zachetka_schowana" onclick="schowajZachetke();"></div>
</div>
CSS
.postac {
position:absolute;
left:20px;
top:200px;
width:246px;
height:246px;
background-image: url(http://dr-det-yp.ydp.eu/rrybacki/res/img.jpg);
}
.zachetka {
position:absolute;
left:20px;
top:20px;
width:1500px;
height:300px;
background-image: url(http://dr-det-yp.ydp.eu/rrybacki/res/imgw3.jpg);
}
JavaScript
window.pokazZachetke = function() {
document.getElementById("zachetka").setAttribute("class", "zachetka");
}
window.schowajZachetke = function() {
document.getElementById("zachetka").setAttribute("class", "zachetka_schowana");
}