xxxxxxxxxx
1
<div class="container my-5">
2
3
<!-- Section: Block Content -->
4
<section>
5
6
<style>
7
.my-custom-scrollbar {
8
position: relative;
9
height: 250px;
10
overflow: auto;
11
}
12
</style>
13
14
<div class="card">
15
<div class="card-header white">
16
<p class="h5-responsive font-weight-bold mb-0"><i class="fas fa-comments pr-2"></i>Chat</p>
17
</div>
18
<div class="card-body my-custom-scrollbar">
19
<div class="media">
20
<img class="avatar rounded-circle card-img-64 z-depth-1 d-flex mr-3" src="https://mdbootstrap.com/img/Photos/Avatars/img%20(32).jpg" alt="Generic placeholder image">
21
<div class="media-body">
22
<h6 class="mt-0 font-weight-bold">Johny Danish<span class="small text-muted float-right pr-2"><i class="far fa-clock pr-1"></i>5:25 AM</span></h6>
23
<p class="mb-0 font-weight-light">I would like to meet you to discuss the latest news about the arrival of the new theme. They say it is going to be one the best themes on the market.</p>
24
25
<div class="media mt-3">
26
<div class="media-body grey lighten-2 p-3 rounded">
27
<h6 class="mt-0 font-weight-bold">Attachements</h6>
28
<small class="font-italic">Theme-thumbnail-image.jpg</small>
29
<div class="text-right">
30
<button class="btn btn-primary btn-sm mb-0 mr-0">Open</button>
31
</div>
32
</div>
33
</div>
34
</div>
35
</div>
36
37
<div class="media mt-4">
38
<img class="avatar rounded-circle card-img-64 z-depth-1 d-flex mr-3" src="https://mdbootstrap.com/img/Photos/Avatars/img%20(21).jpg" alt="Generic placeholder image">
39
<div class="media-body">
40
<h6 class="mt-0 font-weight-bold">Mario Sonetti<span class="small text-muted float-right pr-2"><i class="far fa-clock pr-1"></i>7:30 AM</span></h6>
41
<p class="mb-2 font-weight-light">I would like to meet you to discuss the latest news about the arrival of the new theme. They say it is going to be one the best themes on the market.</p>
42
</div>
43
</div>
44
45
<div class="media mt-4">
46
<img class="avatar rounded-circle card-img-64 z-depth-1 d-flex mr-3" src="https://mdbootstrap.com/img/Photos/Avatars/img%20(20).jpg" alt="Generic placeholder image">
47
<div class="media-body">
48
<h6 class="mt-0 font-weight-bold">Catherine Blake<span class="small text-muted float-right pr-2"><i class="far fa-clock pr-1"></i>10:10 AM</span></h6>
49
<p class="mb-0 font-weight-light">I would like to meet you to discuss the latest news about the arrival of the new theme. They say it is going to be one the best themes on the market.</p>
50
</div>
51
</div>
52
</div>
53
<div class="card-footer white py-3">
54
<div class="form-group mb-0">
55
<textarea class="form-control rounded-0" id="exampleFormControlTextarea1" rows="2" placeholder="Type message..."></textarea>
56
<div class="text-right pt-2">
57
<button class="btn btn-primary btn-sm mb-0 mr-0">Submit</button>
58
</div>
59
</div>
60
</div>
61
</div>
62
63
</section>
64
<!-- Section: Block Content -->
65
66
</div>
1
1
xxxxxxxxxx
1
var myCustomScrollbar = document.querySelector('.my-custom-scrollbar');
2
var ps = new PerfectScrollbar(myCustomScrollbar);
3
4
var scrollbarY = myCustomScrollbar.querySelector('.ps.ps--active-y>.ps__scrollbar-y-rail');
5
6
myCustomScrollbar.onscroll = function() {
7
scrollbarY.style.cssText = `top: ${this.scrollTop}px!important; height: 400px; right: ${-this.scrollLeft}px`;
8
}
Console errors: 0