requestIdleCallback示例

源代码展示

代码

JS初始化
				
var requestId ,
    info = $("#info");
                    
function cb(deadline){
    console.log(deadline);
    var i,
        html = "deadline={
"; for(i in deadline){ html += '    '+i+":"+deadline[i]+",
"; } html += "};"; info.html(html); } requestId = requestIdleCallback(cb);

展示

requestIdleCallback的属性