|
|
(65 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
| <html> | | <html> |
− |
| |
− | <style>
| |
− |
| |
− | /* upwards navigation blob */
| |
− |
| |
− | #upwards_blob{
| |
− | display: none;
| |
− | }
| |
− |
| |
− | /* min-width is chosen so the blob does 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){
| |
− | #upwards_blob{
| |
− | transition: transform 0.5s ease;
| |
− | display: block;
| |
− | position: fixed;
| |
− | right: -100px;
| |
− | bottom: 3%;
| |
− | }
| |
− | }
| |
− |
| |
− | </style>
| |
− |
| |
− |
| |
− | <script>
| |
− |
| |
− | $(document).ready(function(){
| |
− | var $blob = $("#upwards_blob"),
| |
− | $window = $(window),
| |
− | $pageheight = $(document).height()-$window.height(),
| |
− | topPadding = 15;
| |
− |
| |
− | console.log('pageheight:'+$pageheight);
| |
− | console.log('windowwidth:'+$window.width());
| |
− |
| |
− | $(window).scroll(function() {
| |
− | console.log($window.scrollTop()+' pageheight:'+$pageheight);
| |
− |
| |
− | // button disappears on top of the page //
| |
− | if ($window.scrollTop() < 0.05*$pageheight) {
| |
− | console.log('lower');
| |
− | $blob.css({"transform":"translateX(0)"});
| |
− | }
| |
− |
| |
− | // button appears in the middle //
| |
− | if ($window.scrollTop() > 0.05*$pageheight) {
| |
− | if ($window.scrollTop() <($pageheight-100)) {
| |
− | console.log('middle');
| |
− | $blob.css({"transform":"translateX(-110px)"});
| |
− | }
| |
− | }
| |
− |
| |
− | // if there is no lower background image, the button just moves upwards so it doesnt touch the footer //
| |
− | if ($window.width() < 1320) {
| |
− | if ($window.scrollTop() > ($pageheight-100)) {
| |
− | console.log('greater small');
| |
− | $blob.css({"transform":"translate(-110px, -100px)"});
| |
− | }
| |
− | }
| |
− |
| |
− | // if the lower background image is visible, the button moves upwards so it stays just above the image //
| |
− | else {
| |
− | if ($window.scrollTop() > ($pageheight-430)) {
| |
− | console.log('greater wide');
| |
− | $blob.css({"transform":"translate(-110px, 0)"});
| |
− | if ($window.scrollTop() > $pageheight-430) {
| |
− | console.log('blob should move up');
| |
− | $blob.stop().animate({
| |
− | bottom: $window.scrollTop() - $pageheight + 430 + topPadding
| |
− | });
| |
− | }
| |
− | else {
| |
− | $blob.stop().animate({
| |
− | bottom: 30
| |
− | });
| |
− | }
| |
− | }
| |
− | }
| |
− | });
| |
− | });
| |
− |
| |
− | </script>
| |
| | | |
| <div class="content_background_wrapper"> | | <div class="content_background_wrapper"> |
| <div class="central_position_wrap"> | | <div class="central_position_wrap"> |
− | <div id="upwards_blob"><a href="#header"><img src="https://static.igem.org/mediawiki/2015/9/93/Freiburg_upwards_blob.png"></a></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_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="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> |