Team:ETH Zurich/tpl/read-more

From 2014.igem.org

(Difference between revisions)
 
(46 intermediate revisions not shown)
Line 3: Line 3:
$(document).ready(function(){
$(document).ready(function(){
-
   $(".carousel .button").click(function() {
+
  var $p, $el, $ps, $up, $r, totalHeight;
 +
 
 +
   $(".carousel .read-more").click(function() {
totalHeight = 0
totalHeight = 0
Line 10: Line 12:
$p  = $el.parent();
$p  = $el.parent();
$up = $p.parent();
$up = $p.parent();
-
$ps = $up.find("p:not('.read-more')");
+
$ps = $up.children();
$ps.each(function() {
$ps.each(function() {
totalHeight += $(this).outerHeight();
totalHeight += $(this).outerHeight();
});
});
 +
 +
totalHeight -= $p.height();
$up
$up
Line 20: Line 24:
// Set height to prevent instant jumpdown when max height is removed
// Set height to prevent instant jumpdown when max height is removed
"height": $up.height(),
"height": $up.height(),
-
"max-height": 9999999999
+
"max-height": 999999
})
})
.animate({
.animate({
-
"height": totalHeight
+
"height": totalHeight + 280
});
});
Line 32: Line 36:
});
});
-
$(document).ready(function(){
+
 
-
  $("#hideback").click(function(){
+
-
    $(".background").hide();
+
-
  });
+
-
  $("#showback").click(function(){
+
-
    $(".background").show();
+
-
  });
+
-
});
+
-
$(document).ready(function(){
+
-
  $("#hidegoals").click(function(){
+
-
    $(".goals").hide();
+
-
  });
+
-
  $("#showgoals").click(function(){
+
-
    $(".goals").show();
+
-
  });
+
-
});
+
-
$(document).ready(function(){
+
-
  $("#hideimp").click(function(){
+
-
    $(".implementation").hide();
+
-
  });
+
-
  $("#showimp").click(function(){
+
-
    $(".implementation").show();
+
-
  });
+
-
});
+
-
$(document).ready(function(){
+
-
  $("#hidetools").click(function(){
+
-
    $(".tools").hide();
+
-
  });
+
-
  $("#showtools").click(function(){
+
-
    $(".tools").show();
+
-
  });
+
-
});
+
-
$(document).ready(function(){
+
-
  $("#hideapp").click(function(){
+
-
    $(".applications").hide();
+
-
  });
+
-
  $("#showapp").click(function(){
+
-
    $(".applications").show();
+
-
  });
+
-
});
+
</script>
</script>
-
 
+
</html>
-
<div class="inner1">
+
-
<header>
+
-
<h1><a href="#main" id="logo" class="scrolly">Project Overview</a></h1>
+
-
</header>
+
-
</div>
+
-
        <div class="inner2">
+
-
<html/>
+

Latest revision as of 18:20, 11 October 2014