Last active
December 15, 2017 16:56
-
-
Save svaustin66/cbb2111d6bda85c84914f3044f5e3999 to your computer and use it in GitHub Desktop.
JavaScript for showing more or less text
This file contains hidden or 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> | |
$('.readmore').click(function (event) { | |
event.preventDefault(); | |
var descriptionFull = document.querySelector('.product-description-full'); | |
descriptionFull.style.display = 'block'; | |
var descriptionShort = document.querySelector('.product-description-short'); | |
descriptionShort.style.display = 'none'; | |
}); | |
$('.readless').click(function (event) { | |
event.preventDefault(); | |
var descriptionFull = document.querySelector('.product-description-full'); | |
descriptionFull.style.display = 'none'; | |
var descriptionShort = document.querySelector('.product-description-short'); | |
descriptionShort.style.display = 'block'; | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment