Authored by biao

show stander bottom when there is fixed bottom element on page

@@ -106,6 +106,20 @@ function rePosFooter() { @@ -106,6 +106,20 @@ function rePosFooter() {
106 } 106 }
107 } 107 }
108 108
  109 +/**
  110 + *
  111 + * add extra margin-bottom for footer to show yoho copyright when there is fixed bottom element on page
  112 + * @param {String} The jquery selecor of the fixed bottom element
  113 + * @return undefined
  114 + */
  115 +function reMarginFooter(fixedElement) {
  116 + var fixedElH = $(fixedElement).outerHeight();
  117 +
  118 + if(fixedElement){
  119 + $footer.css('margin-bottom', fixedElH + 'px');
  120 + }
  121 +}
  122 +
109 //页面通用底部位置及status设置 123 //页面通用底部位置及status设置
110 (function() { 124 (function() {
111 var $op = $footer.children('.op-row'); 125 var $op = $footer.children('.op-row');
@@ -215,3 +229,5 @@ window.getUid = getUid; @@ -215,3 +229,5 @@ window.getUid = getUid;
215 window.getShoppingKey = getShoppingKey; 229 window.getShoppingKey = getShoppingKey;
216 230
217 window.rePosFooter = rePosFooter; 231 window.rePosFooter = rePosFooter;
  232 +
  233 +window.reMarginFooter = reMarginFooter;
@@ -221,9 +221,7 @@ $('.home-header .iconfont').on('touchstart', function() { @@ -221,9 +221,7 @@ $('.home-header .iconfont').on('touchstart', function() {
221 }); 221 });
222 222
223 // 底部留出tab 的高度 223 // 底部留出tab 的高度
224 -$('#yoho-footer').css({  
225 - 'margin-bottom': '2.5rem'  
226 -}); 224 +window.reMarginFooter('.footer-tab');
227 225
228 //set cookie 226 //set cookie
229 exports.set = function(c) { 227 exports.set = function(c) {
@@ -231,4 +229,4 @@ exports.set = function(c) { @@ -231,4 +229,4 @@ exports.set = function(c) {
231 expires: 365, 229 expires: 365,
232 domain: '.m.yohobuy.com' 230 domain: '.m.yohobuy.com'
233 }); 231 });
234 -};  
  232 +};
@@ -15,7 +15,8 @@ var goodsSwiper, @@ -15,7 +15,8 @@ var goodsSwiper,
15 require('./desc'); 15 require('./desc');
16 require('./comments-consults'); 16 require('./comments-consults');
17 17
18 - 18 +//add extra marign-bottom for footer to show the yoho copyright
  19 +window.reMarginFooter('.cart-bar');
19 20
20 lazyLoad($('img.lazy')); 21 lazyLoad($('img.lazy'));
21 22
@@ -46,4 +47,4 @@ $('.goodsDiscount .dropdown').on('click', function() { @@ -46,4 +47,4 @@ $('.goodsDiscount .dropdown').on('click', function() {
46 $discountFolder.slideUp(); 47 $discountFolder.slideUp();
47 } 48 }
48 }); 49 });
49 -require('./like');  
  50 +require('./like');