Team:ETH Zurich/tpl/read-more

From 2014.igem.org

(Difference between revisions)
Line 2: Line 2:
<script>
<script>
-
$(".carousel .read-more-button").click(function() {
+
$(document).ready(function(){
 +
  $(".carousel .read-more-button").click(function() {
totalHeight = 0
totalHeight = 0
Line 11: Line 12:
$ps = $up.find("p:not('.read-more')");
$ps = $up.find("p:not('.read-more')");
-
// measure how tall inside should be by adding together heights of all inside paragraphs (except read-more paragraph)
 
$ps.each(function() {
$ps.each(function() {
totalHeight += $(this).outerHeight();
totalHeight += $(this).outerHeight();
Line 26: Line 26:
});
});
-
// fade out read-more
 
$p.fadeOut();
$p.fadeOut();
-
// prevent jump-down
 
return false;
return false;
-
+
  });
});
});
 +
$(document).ready(function(){
$(document).ready(function(){
   $("#hideback").click(function(){
   $("#hideback").click(function(){

Revision as of 15:52, 14 August 2014