Last active
April 24, 2017 17:20
-
-
Save IgnacioGaldames/2eefb90f66cddcd70ed10cd038ea70c8 to your computer and use it in GitHub Desktop.
Simple show content con jQuery
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 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