How to create custom scrollbar using jquery mcustomscrollbar plugin ?
In this post we will give you information about How to create custom scrollbar using jquery mcustomscrollbar plugin ?. Hear we will give you detail about How to create custom scrollbar using jquery mcustomscrollbar plugin ?And how to use it also give you demo for it if it is necessary.
In this post, we will learn how to make custom scrollbar will better layout using jquery.mcustomscrollbar plugin. We always want to make best layout of scrollbar instead of default browser layout. default browser layout scrollbar always deferent layout because it depend of browser. So today in this post you can see how to make pretty beautifully scrollbar using mcustomscrollbar plugin. mcustomscrollbar plugin provide us several other option to make more better like set theme and options.
So here i make very simple example using mcustomscrollbar cdn, you can see layout of example and also you can simply run bellow full example. So you can simply use mcustomscrollbar plugin with different theme like as bellow:
(function($){
$(window).on("load",function(){
$(".my-scroll").mCustomScrollbar({theme:"dark-3"});
});
})(jQuery);
Bellow you can see the preview of this example:
Preview:
Example:
<!DOCTYPE html>
<html>
<head>
<title>Custom Scrollbar Example</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.css" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.js"></script>
<style type="text/css">
.my-scroll{
border:1px solid #e1e1e1;
height: 200px;
width:400px;
overflow-y: auto;
}
</style>
</head>
<body>
<div >
<br/>
<h2>Custom scrollbar using jquery mcustomscrollbar Plugin</h2>
<br/>
<div >
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
</div>
<script>
(function($){
$(window).on("load",function(){
$(".my-scroll").mCustomScrollbar({theme:"dark-3"});
});
})(jQuery);
</script>
</body>
</html>
I hope it can help you…
Hope this code and post will helped you for implement How to create custom scrollbar using jquery mcustomscrollbar plugin ?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs