Team:ETH Zurich/js/slide hidden content.js

From 2014.igem.org

(Difference between revisions)
(Created page with "$(document).ready(function() { $("#button").toggle(function() { $(this).text('Hide Content'); }, function() { $(this).text('show Content'); }).click(f...")
 
(6 intermediate revisions not shown)
Line 1: Line 1:
-
$(document).ready(function() {
+
$(".hide_toggle").slideUp(0);
-
    $("#button").toggle(function() {
+
$(".trigger").toggle(function() {
-
         $(this).text('Hide Content');
+
         $(this).text('Show less');
     }, function() {
     }, function() {
-
         $(this).text('show Content');
+
         $(this).text('Show more');
     }).click(function(){
     }).click(function(){
-
        $("#hidden_content").slideToggle("fast");
+
    $(this).prev(".hide_toggle").animate({
-
        $("#hide_content").slideToggle("fast");
+
            height: "toggle",
-
    });
+
            opacity: "toggle"
-
});
+
        }, "slow");
 +
  });

Latest revision as of 23:08, 13 June 2014

$(".hide_toggle").slideUp(0); $(".trigger").toggle(function() {

       $(this).text('Show less');
   }, function() {
       $(this).text('Show more');
   }).click(function(){
   $(this).prev(".hide_toggle").animate({
           height: "toggle",
           opacity: "toggle"
       }, "slow");
 });