- // 控制 logo 的显示位置 Begin
- window.addEventListener("resize", function () {
- // 得到屏幕尺寸 (内部 / 外部宽度, 内部 / 外部高度)
- changeLogoPosition();
- }, false);
- changeLogoPosition();
- function changeLogoPosition() {
- var contentHeight = $("#main_content_div").CSS("height");
- var logoHeight = $("#third_party_logo").css("height");
- contentHeight = parseInt(contentHeight.replace('px', ''));
- logoHeight = parseInt(logoHeight.replace('px', ''));
- //alert('屏幕高度:'+document.body.scrollHeight+'内容高度:'+contentHeight+'logo 高度:'+logoHeight);
- if (document.body.scrollHeight - contentHeight> logoHeight) {
- document.getElementById('third_party_logo').style.position = 'absolute';
- } else {
- document.getElementById('third_party_logo').style.position = '';
- }
- }
- // 控制 logo 的显示位置 End
来源: https://yq.aliyun.com/ziliao/85323