发布于:2017-09-08 17:36:59
function positionFooter() { var footer = $("#fd"); if ((($(document.body).height() + footer.outerHeight()) < $(window).height() && footer.css("position") == "fixed") || ($(document.body).height() < $(window).height() && footer.css("position") != "fixed")) { footer.css({ position: "fixed", bottom: "0", width: '100%' }); } else { footer.css({ position: "static" }); } } function stickFooter(){ $(window).scroll(positionFooter).load(positionFooter).resize(positionFooter); } stickFooter();
登录后可以留言提问!
微信扫码登录