(function ( win, $) { var helper = { //拼接数组: ( dateArr, d, dt, da) contrastDate: function ( dateArr, d, s1, s2) { var da = dateArr, arr = []; for (var i = 0; i < da.length; i++) { var index = ''; for (var j = 0; j < d[s1].length; j++) { var td = d[s1][j]; if (td == da[i]) { index = j; break; } } if (index === 0 || !!index) { arr.push(d[s2][index]); } else { arr.push(0); } } return arr; }, getWeeksData: function ( d, s1, s2) { var wn = $d.getWeeksNum(), arr = {da:[],dt:[]}; for (var i = 1; i <= wn; i++) { var index = ''; for (var j = 0; j < d[s1].length; j++) { var td = d[s1][j]; if (td == i) { index = j; break; } } if (index === 0 || !!index) { arr.da.push(d[s2][index]); } else { arr.da.push(0); } arr.dt.push('第' + i + '周'); } return arr; }, setEvent : function (eArr) {//[[el, event, cb, nel],.....] $.each( eArr, function (ind) { eArr[ind][2] && eArr[ind][0].on( eArr[ind][1], eArr[ind][3] || '', eArr[ind][2]); }); }, initScroll: function (cb) { return new IScrollPullUpDown('wrapper', { probeType: 2, bounceTime: 250, bounceEasing: 'quadratic', mouseWheel: false, scrollbars: true, fadeScrollbars: true, click: true, interactiveScrollbars: false, click: true, }, cb, null); } }; win.$h = helper; })( window, jQuery)