Difference between revisions of "Template:Team:Freiburg/wiki content start bubble"
Line 81: | Line 81: | ||
− | /* | + | /*============== Movement of Amazing Bubble Sidebar ==============*/ |
− | + | /* min-width is chosen so the bubbles do just not interfere with the content box */ | |
− | + | /* 1021 content_box-width + 46 blob-width + 20 scrollbar + some buffer space */ | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
@media screen and (min-width: 1144px){ | @media screen and (min-width: 1144px){ | ||
− | # | + | #upwards_blob{ |
transition: transform 0.5s ease; | transition: transform 0.5s ease; | ||
display: inline; | display: inline; | ||
Line 99: | Line 95: | ||
} | } | ||
} | } | ||
− | |||
</style> | </style> | ||
Line 106: | Line 101: | ||
<script> | <script> | ||
+ | $().ready(function() { | ||
+ | $(function() { | ||
+ | $.fn.scrollBottom = function() { | ||
+ | return $(document).height() - this.scrollTop() - this.height(); | ||
+ | }; | ||
− | + | var $el = $('#bubble_wrapper>div'); | |
− | + | var $window = $(window); | |
− | + | ||
− | + | ||
− | + | $window.bind("scroll resize", function() { | |
− | + | var gap = $window.height() - $el.height() - 370; | |
− | + | var visibleFoot = 172 - $window.scrollBottom(); | |
− | + | var scrollTop = $window.scrollTop() | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | if(scrollTop < 172 + 10){ | ||
+ | $el.css({ | ||
+ | top: (172 - scrollTop) + "px", | ||
+ | bottom: "auto" | ||
+ | }); | ||
+ | }else if (visibleFoot > gap) { | ||
+ | $el.css({ | ||
+ | top: "auto", | ||
+ | bottom: visibleFoot + "px" | ||
+ | }); | ||
} else { | } else { | ||
− | $ | + | $el.css({ |
+ | top: 0, | ||
+ | bottom: "auto" | ||
+ | }); | ||
} | } | ||
}); | }); | ||
− | + | }); | |
− | + | }); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
</script> | </script> | ||
Line 171: | Line 155: | ||
</div> | </div> | ||
− | + | <div class="background_image_left"><img src="https://static.igem.org/mediawiki/2015/8/85/Freiburg_wiki_background_2_parted_left.png"></div> | |
− | + | <div class="background_image_right"><img src="https://static.igem.org/mediawiki/2015/f/f4/Freiburg_wiki_background_2_parted_right.png"></div> | |
<div class="page_content"> | <div class="page_content"> | ||
</html> | </html> |
Revision as of 13:37, 18 September 2015