JSFiddle - React, Tailwind, and code Playground
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:200px;
height:375px;
background:url("../Content/themes/base/images/searchText.png") no-repeat;
}
JavaScript
console.log($('.searchFormWrapper_01').css('left'));
$("#search_TextBox").click(function () {
if ($(".searchFormWrapper_01").css("left") === '-280px'){
$(".searchFormWrapper_01").animate({
left: '0px'
}, 'fast');
} else if ($(".searchFormWrapper_01").css("left") === '0px') {
$(".searchFormWrapper_01").animate({
left: '-280px'
}, 'fast');
}
});