Team:ETH Zurich/tpl/read-more
From 2014.igem.org
(Difference between revisions)
(Created page with "<html> <body class="left-sidebar"> <div id="header"> <div class="inner2"> <header> <h1><a href="#main" id="logo" class="scrolly">Project overview</a></h1> </header> ...") |
|||
(69 intermediate revisions not shown) | |||
Line 1: | Line 1: | ||
<html> | <html> | ||
- | < | + | <script> |
- | + | ||
- | + | $(document).ready(function(){ | |
- | + | var $p, $el, $ps, $up, $r, totalHeight; | |
- | + | ||
- | + | $(".carousel .read-more").click(function() { | |
- | + | ||
- | + | totalHeight = 0 | |
- | + | ||
- | + | $el = $(this); | |
- | < | + | $p = $el.parent(); |
+ | $up = $p.parent(); | ||
+ | $ps = $up.children(); | ||
+ | |||
+ | $ps.each(function() { | ||
+ | totalHeight += $(this).outerHeight(); | ||
+ | }); | ||
+ | |||
+ | totalHeight -= $p.height(); | ||
+ | |||
+ | $up | ||
+ | .css({ | ||
+ | // Set height to prevent instant jumpdown when max height is removed | ||
+ | "height": $up.height(), | ||
+ | "max-height": 999999 | ||
+ | }) | ||
+ | .animate({ | ||
+ | "height": totalHeight + 280 | ||
+ | }); | ||
+ | |||
+ | $p.fadeOut(); | ||
+ | |||
+ | return false; | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | |||
+ | </script> | ||
+ | </html> |
Latest revision as of 18:20, 11 October 2014