Skip to content

Instantly share code, notes, and snippets.

@mbvissers
Created December 29, 2020 15:39
Show Gist options
  • Save mbvissers/7c92477d4bfbf8284af0d73bfaaf55de to your computer and use it in GitHub Desktop.
Save mbvissers/7c92477d4bfbf8284af0d73bfaaf55de to your computer and use it in GitHub Desktop.
<!-- import jQuery using the google CDN -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
$("button#fadeIn").on("click", function () {
$(".fadedText").fadeIn();
})
$("button#fadeOut").on("click", function () {
$(".fadedText").fadeOut();
})
</script>
<button id="fadeIn">Fade text in</button>
<button id="fadeOut">Fade text out</button>
<p class="fadedText">Some nice text to fade in and out</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment