Team:ETH Zurich/js/slide hidden content.js
From 2014.igem.org
(Difference between revisions)
Line 1: | Line 1: | ||
$(".toggle").slideUp(0); | $(".toggle").slideUp(0); | ||
- | $(".trigger").click(function(){ | + | $(".trigger").toggle(function() { |
+ | $(this).text('Show less'); | ||
+ | }, function() { | ||
+ | $(this).text('Show more'); | ||
+ | }).click(function(){ | ||
$(this).prev(".toggle").animate({ | $(this).prev(".toggle").animate({ | ||
height: "toggle", | height: "toggle", |
Revision as of 22:08, 13 June 2014
$(".toggle").slideUp(0); $(".trigger").toggle(function() {
$(this).text('Show less'); }, function() { $(this).text('Show more'); }).click(function(){ $(this).prev(".toggle").animate({ height: "toggle", opacity: "toggle" }, "slow"); });