1
|
var $ = require('yoho-jquery'),
|
1
|
var $ = require('yoho-jquery'),
|
2
|
IScroll = require('yoho-iscroll');
|
2
|
IScroll = require('yoho-iscroll');
|
3
|
|
3
|
|
4
|
-//var WILL_BEGIN = '即将开始';
|
4
|
+// var WILL_BEGIN = '即将开始';
|
5
|
var WILL_END = '即将结束';
|
5
|
var WILL_END = '即将结束';
|
6
|
var ONLINE_FORECAST = '上线预告';
|
6
|
var ONLINE_FORECAST = '上线预告';
|
7
|
|
7
|
|
|
@@ -92,8 +92,29 @@ function activeNav() { |
|
@@ -92,8 +92,29 @@ function activeNav() { |
92
|
|
92
|
|
93
|
}
|
93
|
}
|
94
|
|
94
|
|
|
|
95
|
+function fixNav() {
|
|
|
96
|
+ var navHeight = 0;
|
|
|
97
|
+ var $navContainer = $('#index_nav');
|
|
|
98
|
+
|
|
|
99
|
+ if ($navContainer.size() > 0) {
|
|
|
100
|
+ navHeight = $navContainer.height();
|
|
|
101
|
+
|
|
|
102
|
+ // 顶部app下载位置
|
|
|
103
|
+ $(window).on('scroll', function() {
|
|
|
104
|
+ var scrollTop = $(window).scrollTop();
|
|
|
105
|
+
|
|
|
106
|
+ if (scrollTop >= navHeight) {
|
|
|
107
|
+ $navContainer.addClass('nav-fix');
|
|
|
108
|
+ } else {
|
|
|
109
|
+ $navContainer.removeClass('nav-fix');
|
|
|
110
|
+ }
|
|
|
111
|
+ });
|
|
|
112
|
+ }
|
|
|
113
|
+}
|
95
|
|
114
|
|
96
|
activeNav();
|
115
|
activeNav();
|
|
|
116
|
+fixNav();
|
|
|
117
|
+
|
97
|
|
118
|
|
98
|
module.exports = initNavScroll;
|
119
|
module.exports = initNavScroll;
|
99
|
|
120
|
|