如何编程查找我的浏览器是否支持HTML5混合模式( http://www.w3.org/TR/compositing-1/#mix-blend-mode)?
我的代码结构如下
var canvas = document.getElementById("Canvas");
var context = canvas.getContext("2d");
context.fillStyle = "#fff";
context.fillRect(0, 0, canvas.width, canvas.height);
context.globalCompositeOperation = "source-over"
context.globalCompositeOperation = "soft-light";
if (context.globalCompositeOperation){
//browser supports
alert('true');
}
else {
// browser doesn't support
alert('false');
}
但这似乎不太正确。它提醒‘真’,甚至在IE。(http://caniuse.com/#search=blend说IE不支持混合模式)
发布于 2015-09-24 00:47:50
你应该用
context.globalCompositeOperation = blendMode;
if (context.globalCompositeOperation !== blendMode){
// not supported mode
}
https://stackoverflow.com/questions/32751619
复制相似问题