Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop
Showing
1 changed file
with
3 additions
and
52 deletions
@@ -10,23 +10,11 @@ var $searchBox = $('.search-box'), | @@ -10,23 +10,11 @@ var $searchBox = $('.search-box'), | ||
10 | $box = $('.box'), | 10 | $box = $('.box'), |
11 | $indexSearch = $('.index-search'), | 11 | $indexSearch = $('.index-search'), |
12 | $indexLogo = $('.index-logo'), | 12 | $indexLogo = $('.index-logo'), |
13 | - $channelLink = $('.index-channel a'), | ||
14 | - $win = $(window), | ||
15 | - $doc = $(document), | ||
16 | - $appFloatLayer = $('#float-layer-app'); | 13 | + $channelLink = $('.index-channel a'); |
17 | 14 | ||
18 | var $search = $searchBox.children('input[type="text"]'), | 15 | var $search = $searchBox.children('input[type="text"]'), |
19 | - $cancelSearch = $box.children('.no-search'), | ||
20 | - $searchIcon = $searchBox.children('.search-icon'); | ||
21 | - | ||
22 | -// variables for calculate the app download layer position | ||
23 | -var layerInit = false, | ||
24 | - windowViewHeight = 0, | ||
25 | - layerContentHeight = $appFloatLayer.height(), | ||
26 | - layerPaddingTop = parseInt($appFloatLayer.css('padding-top')), | ||
27 | - layerPaddingBottom = parseInt($appFloatLayer.css('padding-bottom')), | ||
28 | - layerHeight = layerContentHeight + layerPaddingTop + layerPaddingBottom, | ||
29 | - layerNewPos; | 16 | + $cancelSearch = $box.children('.no-search'), |
17 | + $searchIcon = $searchBox.children('.search-icon'); | ||
30 | 18 | ||
31 | require('../common'); | 19 | require('../common'); |
32 | 20 | ||
@@ -81,40 +69,3 @@ $channelLink.on('touchstart', function() { | @@ -81,40 +69,3 @@ $channelLink.on('touchstart', function() { | ||
81 | borderColor: '#fff' | 69 | borderColor: '#fff' |
82 | }); | 70 | }); |
83 | }); | 71 | }); |
84 | - | ||
85 | - | ||
86 | -function updateLayerPosition() { | ||
87 | - var winHeight = window.innerHeight, | ||
88 | - bodyHeight = $doc.height(), | ||
89 | - scrollTopPosition = $win.scrollTop(); | ||
90 | - | ||
91 | - if (layerInit) { | ||
92 | - | ||
93 | - //keyboard is shown | ||
94 | - if (windowViewHeight - winHeight > 200) { | ||
95 | - if (scrollTopPosition + windowViewHeight + layerHeight >= bodyHeight) { | ||
96 | - layerNewPos = 0; | ||
97 | - } else { | ||
98 | - layerNewPos = bodyHeight - windowViewHeight - scrollTopPosition - layerHeight; | ||
99 | - } | ||
100 | - } else { | ||
101 | - layerNewPos = bodyHeight - winHeight - scrollTopPosition; | ||
102 | - } | ||
103 | - | ||
104 | - } else { | ||
105 | - windowViewHeight = winHeight; | ||
106 | - layerNewPos = bodyHeight - winHeight - scrollTopPosition + layerHeight; | ||
107 | - layerInit = true; | ||
108 | - } | ||
109 | - | ||
110 | - $appFloatLayer.css({ | ||
111 | - position: 'relative', | ||
112 | - bottom: layerNewPos + 'px' | ||
113 | - }); | ||
114 | -} | ||
115 | - | ||
116 | -$(window).scroll(function() { | ||
117 | - window.requestAnimationFrame(updateLayerPosition); | ||
118 | -}); | ||
119 | - | ||
120 | -$doc.on('ready', updateLayerPosition); |
-
Please register or login to post a comment