JSFiddle - React, Tailwind, and code Playground
by Tushar Jadhav
HTML
<div class="print-wrap">
<ul>
<li class="settings-tab">+</i>
<div class="settings-wrap">
<div class="iphone-close">x</div>
<div class="content"></div>
</div>
</li>
<li class="img">
<img src="http://placehold.it/250x166">
</li>
</ul>
</div>
CSS
.print-wrap {
width: 250px;
height: 250px;
overflow: hidden;
position: relative;
display: block;
margin: 0 auto;
margin-bottom: 20px;
background-color: #D6A0A0;
}
.print-wrap ul {
list-style: none;
margin: 0;
padding: 0;
height: 100%;
position: relative;
left: 0;
}
.settings-tab {
width: 30px;
height: 30px;
position: absolute;
top: 0;
right: 0;
text-align: center;
background: #f5d43f;
transition: all .3s ease-in-out;
transition-delay: .25s;
z-index: 4;
cursor: pointer;
}
.settings-tab .settings-wrap {
width: 250px;
right: -250px;
height: 250px;
background:lightblue;
position: absolute;
top: 0;
}
.settings-out {
right:250px;
}
.iphone-close {
background:pink;
}
JavaScript
jQuery(function () {
//settings tab:
jQuery('.settings-tab').click(function () {
var $this = jQuery(this);
$this.addClass('settings-out');
});
//Settings tab close
jQuery('.settings-wrap .iphone-close').click(function (e) {
jQuery(this).closest('.settings-out').removeClass('settings-out');
e.stopPropagation();
});
});