Skip to content

Instantly share code, notes, and snippets.

@IgnacioGaldames
Last active April 24, 2017 17:20
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 IgnacioGaldames/2eefb90f66cddcd70ed10cd038ea70c8 to your computer and use it in GitHub Desktop.
Save IgnacioGaldames/2eefb90f66cddcd70ed10cd038ea70c8 to your computer and use it in GitHub Desktop.
Simple show content con jQuery
<button class="btn btn-danger" id="click_desc">
Ver Más
</button>
<section id="desc">
<h1>hide content</h1>
</section>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script>
$(document).ready(function() {
$("button").click(function() {
if ($(this).text() === 'Ver Menos') {
$(this).text('Ver Más');
} else {
$(this).text('Ver Menos');
}
});
$("#click_desc").click(function() {
$("#desc").toggle("slow", function() {
// Animation complete.
});
});
//end desc
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment