fd-gulp-convert-encoding
Version:
convert file to assigned charset
80 lines (58 loc) • 1.78 kB
JavaScript
/**
* @author dongming.jidm
* @date 2013-01-07
* design for responsive
*/
;(function($){
var self,QU = Qingguo.Utility, timer;
var defConfig = {
id: "#doc"
}
function CompanyResponsive(sb) {
Sandbox = sb;
return CompanyResponsive;
}
$.extend(CompanyResponsive,{
init: function(){
self = this;
var docWidth = self.__checkWindowWidth();
if( docWidth < 1190 ) {
$(defConfig.id).addClass('qg-lt-1190');
} else {
$(defConfig.id).addClass('qg-gt-1190');
}
self.__bindEvent();
},
__bindEvent: function() {
$(window).resize(function() {
self.throttle(self);
});
},
__checkWindowWidth: function() {
var width = $(window).innerWidth();
return width;
},
__doResponsive: function( width ) {
if( width < 1190 ) {
$(defConfig.id).removeClass('qg-gt-1190');
$(defConfig.id).addClass('qg-lt-1190');
} else {
$(defConfig.id).removeClass('qg-lt-1190');
$(defConfig.id).addClass('qg-gt-1190');
}
},
// ����ִ��Ƶ�ʿ���
throttle: function() {
var arg = arguments,
method = arg[0];
window.clearTimeout(method.tId);
method.tId = window.setTimeout(function () {
var width = self.__checkWindowWidth();
self.__doResponsive(width);
}, 100);
},
end: 0
});
Qingguo.Business.CompanyResponsive = CompanyResponsive;
AppCore.register("qingguo_mod_company_responsive", Qingguo.Business.CompanyResponsive);
})(jQuery);