Difference between revisions of "Template:Freiburg/wiki content start"
Line 27: | Line 27: | ||
$(document).ready(function(){ | $(document).ready(function(){ | ||
var $blob = $("#upwards_blob"), | var $blob = $("#upwards_blob"), | ||
− | + | $window = $(window), | |
− | + | $pageheight = $(document).height()-$window.height(), | |
− | + | ||
console.log('pageheight:'+$pageheight); | console.log('pageheight:'+$pageheight); | ||
console.log('windowwidth:'+$window.width()); | console.log('windowwidth:'+$window.width()); | ||
console.log('windowheight:'+$window.height()); | console.log('windowheight:'+$window.height()); | ||
− | |||
$(window).scroll(function(event) { | $(window).scroll(function(event) { | ||
− | console.log($ | + | console.log($(this).scrollTop()+' pageheight:'+$pageheight); |
var y = $(this).scrollTop(); | var y = $(this).scrollTop(); | ||
Line 43: | Line 41: | ||
if (y < 60) { | if (y < 60) { | ||
console.log('lower'); | console.log('lower'); | ||
− | $blob.css({"top": $ | + | $blob.css({"top": $(this).height() + 30, "right": 30}); // = 30 px under bottom |
} | } | ||
Line 50: | Line 48: | ||
if (y <($pageheight-100)) { | if (y <($pageheight-100)) { | ||
console.log('middle'); | console.log('middle'); | ||
− | $blob.css({"top": y + $ | + | $blob.css({"top": y + $(this).height() - 300, "right": 30}); // = 30 px from bottom |
} | } | ||
} | } |
Revision as of 06:11, 8 September 2015