Exploring the development of a swipe-to-action list component.
<div class="list-container">
<div class="row">
<div class="content">
Sample Content 1
</div>
<div class="action">
Delete Action
</div>
</div>
<div class="row">
<div class="content">
Additional Content 2...
</div>
<div class="action">
Delete Action
</div>
</div>
</div>
The action div is positioned absolutely with a z-index lower than that of the content div.
The objective is to have the content div overlap the absolutely positioned action div, all without applying a background-color
to the content div. When the user swipes the list, the content div will be moved along the X-axis to reveal the action underneath it.
Check out a live example here.
Note that the content in the second row does not have a background color applied, which allows the action to remain visible.
Are there alternative methods to achieve this effect?