-
-
Save creyn/deee7f852a04790958c12828795102a0 to your computer and use it in GitHub Desktop.
Droga Programisty : Szybkie Palce : deaktywacja przycisku
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
<!-- dzieki zastosowaniu obrazka, filtrow i pseudoklasy hover z jednego obrazka mozemy zrobic ladny przycisk --> | |
<img id="przyciskStart" class="active" src="obrazki/start.png" onclick="RozpocznijGre()"> |
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
// Funkcja wylaczajaca przycisk START | |
function WylaczPrzyciskStart() { | |
document.getElementById('przyciskStart').classList.remove('active'); | |
document.getElementById('przyciskStart').classList.add('inactive'); | |
... | |
} | |
// Funkcja sluzy do rozpoczynania nowej gry | |
function RozpocznijGre() { | |
// sprawdzamy czy przycisk jest aktywny, jezeli nie to wychodzimy | |
if(!document.getElementById('przyciskStart').classList.contains('active')) { | |
return; | |
} | |
WylaczPrzyciskStart(); | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment