Team:ETH Zurich/tpl/read-more
From 2014.igem.org
(Difference between revisions)
(20 intermediate revisions not shown) | |||
Line 3: | Line 3: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
- | var $p, $el, $ps, $up, totalHeight; | + | var $p, $el, $ps, $up, $r, totalHeight; |
- | $(".carousel . | + | $(".carousel .read-more").click(function() { |
totalHeight = 0 | totalHeight = 0 | ||
Line 12: | Line 12: | ||
$p = $el.parent(); | $p = $el.parent(); | ||
$up = $p.parent(); | $up = $p.parent(); | ||
- | $ | + | $ps = $up.children(); |
- | + | ||
$ps.each(function() { | $ps.each(function() { | ||
- | totalHeight += $(this). | + | totalHeight += $(this).outerHeight(); |
}); | }); | ||
+ | |||
+ | totalHeight -= $p.height(); | ||
$up | $up | ||
Line 26: | Line 27: | ||
}) | }) | ||
.animate({ | .animate({ | ||
- | "height": totalHeight | + | "height": totalHeight + 280 |
}); | }); | ||
Line 37: | Line 38: | ||
</script> | </script> | ||
- | + | </html> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + |
Latest revision as of 18:20, 11 October 2014