Created
August 14, 2018 15:56
-
-
Save bokuo-okubo/8fbf9843a53bf886357134164f2177af to your computer and use it in GitHub Desktop.
GBLwMa
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
<button id="trigger-button">toggle!</button> | |
<div id="viewer"> | |
<div id="value-field"></div> | |
</div> |
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
(function() { | |
var displayArray = ['😆', '🤔', '😭']; | |
var display = displayArray[0]; | |
var counter = 0; | |
$('#value-field').text(display); | |
$('#trigger-button').click(function() { | |
counter += 1; | |
display = displayArray[counter % displayArray.length]; | |
$('#value-field').text(display); | |
}); | |
})(); |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> |
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
#viewer { | |
width: 200px; | |
height: 200px; | |
border-style: solid; | |
border-width: 1px; | |
text-align: center; | |
} | |
#value-field { | |
padding: 10px 10px; | |
font-size: 180px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment