调整页脚

This commit is contained in:
yangjian 2020-04-20 08:05:24 +08:00
parent c64e62749b
commit 9bcf043027
2 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<div class="layui-footer" style="border-top: 1px #e6e6e6 solid;text-align:center;margin-top:20px;width:100%;">
<div class="layui-footer" style="border-top: 1px #e6e6e6 solid;text-align:center;margin-top:10px;width:100%;">
<div style="margin-top:10px;">
© <a href="/">MrDoc 2019-2020</a>&nbsp;|&nbsp;
<span class="layui-hide-xs">基于<a href="https://www.djangoproject.com/" target="_blank">Django</a>&nbsp;|&nbsp;</span>

View File

@ -248,13 +248,13 @@
/*
scrollTop() 设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
*/
footerTop = ($(window).scrollTop() + $(window).height() - footerHeight - 40)+"px";
footerTop = ($(window).scrollTop() + $(window).height() - footerHeight - 35)+"px";
// console.log("页脚高度:",footerHeight)
// console.log(footerTop)
// console.log($(".layui-header").height()+$(".layui-container").height())
// console.log("窗口高度:",$(window).height())
//如果页面内容高度小于屏幕高度div#footer将绝对定位到屏幕底部否则div#footer保留它的正常静态定位
if(($(".layui-header").height() + $(".index-control").height() + $(".project-list-content").height() + $(".project-list-page").height() + 15) < $(window).height()) {
if(($(".layui-header").height() + $(".index-control").height() + $(".project-list-content").height() + $(".project-list-page").height() + 16) < $(window).height()) {
console.log("页脚置底")
$(".layui-footer").css({ position: "absolute",left:"0" }).stop().css({top:footerTop});
}else{