Skip to content

Instantly share code, notes, and snippets.

@rheajt
Last active November 21, 2016 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rheajt/dc475bf3798506f32ec139371d04cd52 to your computer and use it in GitHub Desktop.
Save rheajt/dc475bf3798506f32ec139371d04cd52 to your computer and use it in GitHub Desktop.
create a hidden element gist for digital breakouts

Create a hidden element for a better display on the Ipad

function doGet() {
//open the Hidden.html page
return HtmlService.createHtmlOutputFromFile('Hidden');
}
<h1 id="asterisk">*</h1>
<h2 id="hidden-text" style="display:none">This is the hidden text</h2>
<script>
//create an event listener on the asterisk for a mousedown or pressdown on ipad
document.getElementById('asterisk').addEventListener('mousedown', function() {
//make the hidden-text element visible
document.getElementById('hidden-text').style.display = 'block';
});
//create an event listener for the mouse up to make the hidden-text disappear
document.getElementById('asterisk').addEventListener('mouseup', function() {
document.getElementById('hidden-text').style.display = 'none';
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment