update app-download layer position dynamicly for the home page
Showing
1 changed file
with
3 additions
and
7 deletions
@@ -68,7 +68,7 @@ $channelLink.on('touchstart', function() { | @@ -68,7 +68,7 @@ $channelLink.on('touchstart', function() { | ||
68 | borderColor: '#fff' | 68 | borderColor: '#fff' |
69 | }); | 69 | }); |
70 | }); | 70 | }); |
71 | -var removeAppFloatLayerFixed = (function() { | 71 | +var updateLayerPosition = (function() { |
72 | var init = false; | 72 | var init = false; |
73 | return function() { | 73 | return function() { |
74 | var winHeight = window.innerHeight; | 74 | var winHeight = window.innerHeight; |
@@ -92,11 +92,7 @@ var removeAppFloatLayerFixed = (function() { | @@ -92,11 +92,7 @@ var removeAppFloatLayerFixed = (function() { | ||
92 | })(); | 92 | })(); |
93 | 93 | ||
94 | $win.scroll(function() { | 94 | $win.scroll(function() { |
95 | - | ||
96 | - clearTimeout($.data(this, 'scrollTimer')); | ||
97 | - $.data(this, 'scrollTimer', setTimeout(function() { | ||
98 | - removeAppFloatLayerFixed(); | ||
99 | - }, 2)); | 95 | + updateLayerPosition(); |
100 | }); | 96 | }); |
101 | 97 | ||
102 | $win.on('resize', function(){ | 98 | $win.on('resize', function(){ |
@@ -107,4 +103,4 @@ $win.on('scrollstop', function(){ | @@ -107,4 +103,4 @@ $win.on('scrollstop', function(){ | ||
107 | console.log('stop'); | 103 | console.log('stop'); |
108 | }); | 104 | }); |
109 | 105 | ||
110 | -$doc.on('ready', removeAppFloatLayerFixed); | 106 | +$doc.on('ready', updateLayerPosition); |
-
Please register or login to post a comment