JSFiddle - React, Tailwind, and code Playground
by mohammadAdil
HTML
<div class="container">
<div class="searchFormWrapper_01">
<div class="search_form">my content</div> <span id="search_TextBox">my image</span>
</div>
</div>
CSS
container {
background-color:red;
width:66em;
height:375px;
margin: 0 auto;
position:relative;
overflow:hidden;
}
.searchFormWrapper_01 {
width:330px;
height:375px;
position:absolute;
background-color:green;
left:-280px;
}
.search_form {
float:left;
width:270px;
height:375px;
background-color:pink;
margin-left:10px;
}
#search_TextBox {
float:left;
width:50px;
height:375px;
background:url("../Content/themes/base/images/searchText.png") no-repeat;
}
JavaScript
$("#search_TextBox").click(function () {
if ($(".searchFormWrapper_01").css("left") != 0) {
$(".searchFormWrapper_01").animate({
left: 0
}, 'fast');
} else if ($(".searchFormWrapper_01").css("left") == 0) {
$(".searchFormWrapper_01").animate({
left: -280
}, 'fast');
}
});