Showing
4 changed files
with
27 additions
and
3 deletions
@@ -5,6 +5,10 @@ | @@ -5,6 +5,10 @@ | ||
5 | */ | 5 | */ |
6 | var $ = require('jquery'); | 6 | var $ = require('jquery'); |
7 | 7 | ||
8 | +var $footer = $('#yoho-footer'); | ||
9 | + | ||
10 | +var FOOTERHEIGHT = 120; //footer height | ||
11 | + | ||
8 | function cookie(name) { | 12 | function cookie(name) { |
9 | var cookies = document.cookie, | 13 | var cookies = document.cookie, |
10 | cookieVal, | 14 | cookieVal, |
@@ -90,14 +94,26 @@ function getShoppingKey() { | @@ -90,14 +94,26 @@ function getShoppingKey() { | ||
90 | return JSON.parse(c).k; | 94 | return JSON.parse(c).k; |
91 | } | 95 | } |
92 | 96 | ||
97 | +//根据页面内容重新设置通用底部的显示 | ||
98 | +function rePosFooter() { | ||
99 | + if ($footer.length === 0) { | ||
100 | + return; | ||
101 | + } | ||
102 | + | ||
103 | + if ($('body').height() < $(window).height() - FOOTERHEIGHT) { | ||
104 | + $footer.addClass('bottom'); | ||
105 | + } else { | ||
106 | + $footer.removeClass('bottom'); | ||
107 | + } | ||
108 | +} | ||
109 | + | ||
93 | //页面通用底部位置及status设置 | 110 | //页面通用底部位置及status设置 |
94 | (function () { | 111 | (function () { |
95 | - var $footer = $('#yoho-footer'), | ||
96 | - $op = $footer.children('.op-row'); | 112 | + var $op = $footer.children('.op-row'); |
97 | 113 | ||
98 | var user = getUser(); | 114 | var user = getUser(); |
99 | 115 | ||
100 | - if ($('body').height() < $(window).height()) { | 116 | + if ($('body').height() < $(window).height() - FOOTERHEIGHT) { |
101 | $footer.addClass('bottom'); | 117 | $footer.addClass('bottom'); |
102 | } | 118 | } |
103 | 119 | ||
@@ -132,3 +148,5 @@ window.getUser = getUser; | @@ -132,3 +148,5 @@ window.getUser = getUser; | ||
132 | window.getUid = getUid; | 148 | window.getUid = getUid; |
133 | 149 | ||
134 | window.getShoppingKey = getShoppingKey; | 150 | window.getShoppingKey = getShoppingKey; |
151 | + | ||
152 | +window.rePosFooter = rePosFooter; |
-
Please register or login to post a comment