"Button Slide text search"
Bootstrap 3.0.0 Snippet by bnk2972

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<div class="container">
<div class="row">
<div class="col-md-4">
<div class="box-search">
<input type="text" id="search" class="form-control">
<div class="tab-search">
<label for="search">
<span class="glyphicon glyphicon-search"></span>
</label>
</div>
</div>
<div class="box-search m-t-20">
<input type="text" placeholder="Search" id="search-2" class="form-control">
<button type="submit" class="btn btn-default">Submit</button>
<div class="tab-search-2">
<label for="search-2">
<span class="glyphicon glyphicon-search"></span>
</label>
</div>
</div>
</div>
</div>
</div>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
body {
padding: 100px;
}
.box-search {
position: relative;
overflow: hidden;
width: 300px;
height: 35px;
}
.tab-search {
margin-left: 36px;
width: 100%;
position: absolute;
top: 0;
left: -36px;
height: 35px;
background: #fff;
transition: left .5s;
-webkit-transition: left .5s;
-o-transition: left .5s;
-moz-transition: left .5s;
}
.tab-search-2 {
margin-left: 36px;
width: 100%;
position: absolute;
top: 0;
left: -36px;
height: 35px;
background: #fff;
transition: left .5s;
-webkit-transition: left .5s;
-o-transition: left .5s;
-moz-transition: left .5s;
}
.tab-search-2 > label {
border-radius: 50%;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$(document).ready(function() {
$(".tab-search > label").click(function() {
if ($(".tab-search").hasClass("open")) {
$(".tab-search").removeClass("open");
} else {
$(".tab-search").addClass("open");
}
});
$(".tab-search-2 > label").click(function() {
if ($(".tab-search-2").hasClass("open")) {
$(".tab-search-2").removeClass("open");
} else {
$(".tab-search-2").addClass("open");
}
});
$(".main-button").click(function() {
if ($(".sub-button-list").hasClass("open")){
$(".sub-button-list").removeClass("open");
} else {
$(".sub-button-list").addClass("open");
}
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: