Difference between revisions of "MediaWiki:Vector.js"
From Drawn to Life Wiki
(Blanked the page) Tag: Blanking |
|||
| Line 1: | Line 1: | ||
| + | $(window).bind("load", function() { | ||
| + | |||
| + | var footerHeight = 0, | ||
| + | footerTop = 0, | ||
| + | $footer = $("#footer"); | ||
| + | |||
| + | positionFooter(); | ||
| + | |||
| + | function positionFooter() { | ||
| + | |||
| + | footerHeight = $footer.height(); | ||
| + | footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px"; | ||
| + | |||
| + | if ( ($(document.body).height()+footerHeight) < $(window).height()) { | ||
| + | $footer.css({ | ||
| + | position: "absolute" | ||
| + | }).animate({ | ||
| + | top: footerTop | ||
| + | }) | ||
| + | } else { | ||
| + | $footer.css({ | ||
| + | position: "static" | ||
| + | }) | ||
| + | } | ||
| + | |||
| + | } | ||
| + | $(window) | ||
| + | .scroll(positionFooter) | ||
| + | .resize(positionFooter) | ||
| + | |||
| + | }); | ||
Revision as of 07:51, 20 November 2020
$(window).bind("load", function() {
var footerHeight = 0,
footerTop = 0,
$footer = $("#footer");
positionFooter();
function positionFooter() {
footerHeight = $footer.height();
footerTop = ($(window).scrollTop()+$(window).height()-footerHeight)+"px";
if ( ($(document.body).height()+footerHeight) < $(window).height()) {
$footer.css({
position: "absolute"
}).animate({
top: footerTop
})
} else {
$footer.css({
position: "static"
})
}
}
$(window)
.scroll(positionFooter)
.resize(positionFooter)
});