unction?get_hfs()?{
????document.documentElement.style.fontSize?=?document.documentElement.clientWidth?/?7.5?+?'px';
}
get_hfs();
function?throttle(method,?context)?{
????clearTimeout(method.timer);
????method.timer?=?setTimeout(function()?{
????????method.call(context);
????},?100)
}
window.onresize?=?function()?{
????throttle(get_hfs);
}?method.timer = setTimeout(function() {? ? ? ? method.call(context);? ? }, 100)//context 不是沒有參數(shù)傳進來嗎?這一句話有什么用?
一段關(guān)于 call 的代碼沒看懂,求解釋.
熠熠生陽
2017-04-07 17:12:47