S
S
secretsergey2018-12-12 17:45:09
css
secretsergey, 2018-12-12 17:45:09

Is it possible to make a slide disappear cross-browser?

Hello.
Immediately for clarity, I will give a link to codepen .
There is the following task. The site page has a slider ( slick ) with the following parameters:

$('.slider').slick({
centerMode: true,
centerPadding: '50px',
arrows:false
});

As you can see, adjacent slides are visible along the edges of the slider and you need to apply a fade effect for them.
Example . Here the photo disappears into a solid background. I also need to dissolve adjacent slides.
If the background was solid (one color), then this task could be implemented through a background gradient, but as shown in the example, there is an image on the background. You can implement it through mask svg, but there is no cross-browser compatibility.
I'll be grateful for the hint.

Desired result (example):24574143.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lamer350, 2018-12-12
@lamer350

Overlay :before on top of an absolutely positioned image and apply a gradient to it via css

V
Vadim Kot, 2018-12-12
@vadimkot

It is not possible cross-browser, but there is a mask-image for such an effect (example https://codepen.io/anon/pen/QzjEgq ).
But as part of Graceful Degradation, browsers that don't have mask-image support will display the version without the fading effect.
https://caniuse.com/#feat=css-masks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question