Showing
3 changed files
with
26 additions
and
7 deletions
@@ -66,7 +66,7 @@ exports.init = function() { | @@ -66,7 +66,7 @@ exports.init = function() { | ||
66 | thumbContainer | 66 | thumbContainer |
67 | .addClass('fixed-bottom') | 67 | .addClass('fixed-bottom') |
68 | .removeClass('static'); | 68 | .removeClass('static'); |
69 | - } else if (sTop <= containerTop - wH + tContainerH) { | 69 | + } else if (sTop <= containerTop) { |
70 | thumbContainer | 70 | thumbContainer |
71 | .addClass('static') | 71 | .addClass('static') |
72 | .removeClass('fixed-bottom fixed-top'); | 72 | .removeClass('fixed-bottom fixed-top'); |
@@ -94,5 +94,24 @@ exports.init = function() { | @@ -94,5 +94,24 @@ exports.init = function() { | ||
94 | if ($(document).scrollTop() === 0) { | 94 | if ($(document).scrollTop() === 0) { |
95 | $(document).scroll(); | 95 | $(document).scroll(); |
96 | } | 96 | } |
97 | + | ||
98 | + //计算小箭头位置 | ||
99 | + (function (doc, win) { | ||
100 | + var docEl = doc.documentElement, | ||
101 | + resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', | ||
102 | + arrowPosition = function () { | ||
103 | + var clientWidth = docEl.clientWidth; | ||
104 | + if (!clientWidth) { | ||
105 | + return; | ||
106 | + } | ||
107 | + docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | ||
108 | + }; | ||
109 | + | ||
110 | + if (!doc.addEventListener) { | ||
111 | + return; | ||
112 | + } | ||
113 | + win.addEventListener(resizeEvt, arrowPosition, false); | ||
114 | + doc.addEventListener('DOMContentLoaded', arrowPosition, false); | ||
115 | + })(document, window); | ||
97 | }); | 116 | }); |
98 | }; | 117 | }; |
@@ -7,16 +7,17 @@ $pxConvertRem : 40; | @@ -7,16 +7,17 @@ $pxConvertRem : 40; | ||
7 | 7 | ||
8 | /*container脱离文本流时占位用,指定高度为内部所有内容高度*/ | 8 | /*container脱离文本流时占位用,指定高度为内部所有内容高度*/ |
9 | .container-fixed-pos { | 9 | .container-fixed-pos { |
10 | - height: 175rem / $pxConvertRem; | 10 | + height: 195rem / $pxConvertRem; |
11 | margin-left: -15rem / $pxConvertRem; | 11 | margin-left: -15rem / $pxConvertRem; |
12 | + | ||
12 | } | 13 | } |
13 | 14 | ||
14 | .thumb-container { | 15 | .thumb-container { |
15 | font-size: 0; | 16 | font-size: 0; |
16 | - padding: 20rem / $pxConvertRem 0 0 20rem / $pxConvertRem; /*修改padding-bottom时请修正.container-fixed-pos高度*/ | ||
17 | - background: #fff; | 17 | + padding: 30rem / $pxConvertRem 0 0 30rem / $pxConvertRem; /*修改padding-bottom时请修正.container-fixed-pos高度*/ |
18 | z-index: 10; | 18 | z-index: 10; |
19 | - border-bottom: 1px solid #b0b0b0; | 19 | + background: url('../img/thumb-container-bg.png') no-repeat -72rem / $pxConvertRem bottom; |
20 | + background-size: 200% 100%; | ||
20 | 21 | ||
21 | &.fixed-top { | 22 | &.fixed-top { |
22 | position: fixed; | 23 | position: fixed; |
@@ -48,7 +49,7 @@ $pxConvertRem : 40; | @@ -48,7 +49,7 @@ $pxConvertRem : 40; | ||
48 | display: inline-block; | 49 | display: inline-block; |
49 | position: relative; | 50 | position: relative; |
50 | margin-right: 22rem / $pxConvertRem; | 51 | margin-right: 22rem / $pxConvertRem; |
51 | - padding-bottom: 20rem / $pxConvertRem; /*修改padding-bottom时请修正.container-fixed-pos高度*/ | 52 | + padding-bottom: 30rem / $pxConvertRem; /*修改padding-bottom时请修正.container-fixed-pos高度*/ |
52 | 53 | ||
53 | &:last-child { | 54 | &:last-child { |
54 | margin-right: 0; | 55 | margin-right: 0; |
@@ -6,7 +6,6 @@ | @@ -6,7 +6,6 @@ | ||
6 | <li class="thumb"> | 6 | <li class="thumb"> |
7 | <img class="thumb-img lazy" data-original="{{thumb}}"> | 7 | <img class="thumb-img lazy" data-original="{{thumb}}"> |
8 | <span class="clothe-type {{type}}"></span> | 8 | <span class="clothe-type {{type}}"></span> |
9 | - <em class="arrow"></em> | ||
10 | </li> | 9 | </li> |
11 | {{/ list}} | 10 | {{/ list}} |
12 | </ul> | 11 | </ul> |
-
Please register or login to post a comment