![]() |
VOOZH | about |
The Spectre Comparison slider is an image comparison slider that essentially aids in the distinction of two photographs or products. As a result, the user can quickly determine which of the two products or two images are better. In this article, we will create that with ease with the Spectre classes.
Spectre Comparison sliders:
Syntax:
<div class="comparison-slider">
<figure class="comparison-before">
...
<div class="comparison-label">..</div>
</figure>
<figure class="comparison-after">
...
<div class="comparison-label">..</div>
<textarea class="comparison-resizer"></textarea>
</figure>
</div>
Example 1: In this example, we will create a two-image comparison interface.
Output:
Example 2: We can also use this feature as a drawer image. In this example, we will create a drawer image effect, by using only the comparison-after class.
Output:
Reference:https://picturepan2.github.io/spectre/experimentals/comparison.html#comparison