Showing
2 changed files
with
6 additions
and
6 deletions
@@ -34,12 +34,12 @@ function initNavScroll(opt) { | @@ -34,12 +34,12 @@ function initNavScroll(opt) { | ||
34 | }; | 34 | }; |
35 | } | 35 | } |
36 | 36 | ||
37 | -//获取url中的参数 | 37 | +// 获取url中的参数 |
38 | function getUrlParam(name) { | 38 | function getUrlParam(name) { |
39 | - var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); //构造一个含有目标参数的正则表达式对象 | ||
40 | - var r = window.location.search.substr(1).match(reg); //匹配目标参数 | 39 | + var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)'); // 构造一个含有目标参数的正则表达式对象 |
40 | + var r = window.location.search.substr(1).match(reg); // 匹配目标参数 | ||
41 | 41 | ||
42 | - //返回参数值 | 42 | + // 返回参数值 |
43 | if (r !== null) { | 43 | if (r !== null) { |
44 | return decodeURIComponent(r[2]); | 44 | return decodeURIComponent(r[2]); |
45 | } else { | 45 | } else { |
@@ -47,7 +47,7 @@ function getUrlParam(name) { | @@ -47,7 +47,7 @@ function getUrlParam(name) { | ||
47 | } | 47 | } |
48 | } | 48 | } |
49 | 49 | ||
50 | -//选中顶部导航 | 50 | +// 选中顶部导航 |
51 | function activeNav() { | 51 | function activeNav() { |
52 | var $nav = $('#index_nav'); | 52 | var $nav = $('#index_nav'); |
53 | var index = getUrlParam('yh_channel'); | 53 | var index = getUrlParam('yh_channel'); |
-
Please register or login to post a comment