T
T
ti_cho2017-01-11 16:58:29
css
ti_cho, 2017-01-11 16:58:29

How to check if browser supports css blend modes?

How to track through javascript or jQuery whether the browser supports the mix-blend-mode: multiply property so that later, depending on whether this property works or not, change backgrounds, images, etc.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Mr Crabbz, 2017-01-11
@Punkie

https://modernizr.com/ - plugin
stackoverflow.com/questions/28087877/testing-of-cs... - solution to your problem

D
dom1n1k, 2017-01-11
@dom1n1k

If you want to check exactly the support of the property, then it seems that there is no completely reliable way. In any case, I don't know him.
With blending modes, everything is not easy there, some browsers support it partially, plus they can work differently for HTML / SVG elements.
Supports does not actually work at the moment, because not everyone supports it.
You need to test exactly the case that is needed specifically for the task, outline the circle of browsers and then check the browser.
Yes, it's not very convenient, but I don't know any other way.

S
Sergey Sokolov, 2017-07-02
@abra-cadabra

var re = new RegExp('<p><br></p>', 'ig'); 
// флаги:
// i - игнорировать регистр, 
// g - искать/заменять во всей строке много раз

var test = '<p><br></p>-<p><br></p>+<p><br></p>//<p><br></p>##<p><br></p>';
test.replace(re, '' ) // -+//##

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question