"slider open on fixed button"
Bootstrap 4.1.1 Snippet by imsachin

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
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!--Topic sticky start-->
<div class="topic-sticky">
<div class="sidebar">
<h5 href="">Topic In Demand</h5>
<div class="sidebar-body">
<a href="">Article</a>
<a href="">Article</a>
<a href="">Article</a>
<a href="">Article</a>
<a href="">Article</a>
<a href="">Article</a>
<a href="">Article</a>
<a href="">Article</a>
</div>
</div>
<button class="btn btn-primary topic-fixed" role="button">
Topic in demand
</button>
</div>
<!--Topic sticky end-->
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
/*Topic sticky*/
.topic-sticky {
position: fixed;
top: 50%;
z-index: 999;
display: flex;
justify-content: center;
align-items: center;
}
.topic-sticky .btn-primary {
background-color: #951b28;
border-color: #951b28;
border-radius: 0px;
transform: translate(-38%, 0%) rotate(270deg);
white-space: nowrap;
}
.topic-sticky .sidebar {
width: 100%;
background: #ffffff;
border-right: 1px solid rgba(0, 0, 0, .2);
transition: transform .3s ease-in-out;
padding: 10px;
height: 100%;
box-shadow: 0px 0px 5px #c0b9b9;
}
.topic-sticky .sidebar h5 {
font-size: 20px;
font-weight: bold;
color: #951b28;
margin-bottom: 5;
line-height: 1.5;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
$(document).ready(function() {
$(".topic-fixed").click(function() {
$(".sidebar").toggle(1000);
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments: