Difference between revisions of "Template:Team:Freiburg/wiki content start bubble"
Line 17: | Line 17: | ||
margin-left: 1%; | margin-left: 1%; | ||
margin-top: 5%; | margin-top: 5%; | ||
− | position: fixed; top: 10%; | + | /*position: fixed; top: 10%; */ |
+ | position:fixed; | ||
} | } | ||
Line 98: | Line 99: | ||
</style> | </style> | ||
+ | |||
+ | |||
+ | <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() - 10; | ||
+ | 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 { | ||
+ | $el.css({ | ||
+ | top: 0, | ||
+ | bottom: "100" | ||
+ | }); | ||
+ | } | ||
+ | }); | ||
+ | }); | ||
+ | }); | ||
+ | |||
+ | </script> | ||
Revision as of 12:55, 18 September 2015