ctx.drawImage(that, 0, 0);”(大概第99行);将其修改为
ctx.drawImage(that, 0, 0,width,height);,即可使ip6也满画布。 前后对比:
回复
css://- 代码区![]()
![]()
![]()
.index img{
width: 100%;
position: absolute;
top: 0;
left: 0;
}
#easer{
position: absolute;
z-index: 2;
}
#index-img{
z-index: 1;
}//- 代码区
若上面没有对“#easer“定义”position“的话会发现这个插件失效了。虽然上面的css选择器里已经定义过一次position了,但是实际上这时候”#easer“已经不在”index“的img后代中了。(”#easer“这个元素已经成为canvas元素了。)
虽然是个简单的问题,但是还是希望作者强调下这个问题。。毕竟对于新手来说这个问题还是蛮折腾人的。。
回复
关于触发回调函问题,实现代码如下.
addEventListener( "load", init, false );
function init( event ) {
$("#redux").eraser({
size: 120,
completeRatio: .5,
completeFunction: showResetButton,
});
}
function showResetButton(){
alert("百分之50后执行");
}