http://jsfiddle.net/q1a4wwar/7/
I want to do like native feel kind of navigation using web css. But I stuck at bringing back my .content slide back to the left. Try click on the item and then click on the back, you will notice my problem there.
$(function(){
$('.item').on('click', function(){
$(this).addClass('slideLeftItem');
$('.content').show(0,'', function(){
$('#back').show();
}).addClass('slideRightContent');
});
$('#back').on('click',function(){
$('.item').show().removeClass('slideLeftItem');
$(this).hide();
$('.content').hide().removeClass('slideRightContent');
});
});
.content{
display:none;
position: absolute;
right: -200px;
top: 0px;
background: blue;
transition: 0.4s;
}
.item{
position: absolute;
left: 0;
top: 0px;
transition: 0.4s;
}
.slideRightContent{
right: 0px;
}
.slideLeftItem{
left: -200px;
}
#back{
display:none;
height: 20px !Important;
background: grey !Important;
}
.content, .item{
width:200px;
height: 200px;
background: red;
}
.phone{
position: relative;
overflow: hidden;
transition: 0.4s;
width:200px;
border: 10px solid #000;
height:200px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="back">< back</div>
<br>
<div class="phone">
<div class="item">item</div>
<div class="content">My content</div>
</div>