Team:ETH Zurich/tpl/read-more

From 2014.igem.org

(Difference between revisions)
 
(52 intermediate revisions not shown)
Line 2: Line 2:
<script>
<script>
-
$(".carousel .button").click(function() {
+
$(document).ready(function(){
 +
  var $p, $el, $ps, $up, $r, totalHeight;
 +
 
 +
  $(".carousel .read-more").click(function() {
totalHeight = 0
totalHeight = 0
Line 9: Line 12:
$p  = $el.parent();
$p  = $el.parent();
$up = $p.parent();
$up = $p.parent();
-
$ps = $up.find("p:not('.read-more')");
+
$ps = $up.children();
-
// 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();
});
});
 +
 +
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": 9999
+
"max-height": 999999
})
})
.animate({
.animate({
-
"height": totalHeight
+
"height": totalHeight + 280
});
});
-
// fade out read-more
 
$p.fadeOut();
$p.fadeOut();
-
// prevent jump-down
 
return false;
return false;
-
+
  });
-
});
+
-
$(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