How to create custom scroll-bar in a div by JQuery

Web Development, Analytics & SEO Agency

Web Development Search Marketing

How to create custom scroll-bar in a div by JQuery

How to create custom scroll-bar in a div by JQuery

This blog post will show how to create custom scroll in a div. Normally when we fixed width for a div and the style for the div is overflow: scroll it shows default scroll. Today we describe how we can customize this scroll.

html head titlecreate custom scroll/title link rel=stylesheet type=text/css href=style.css /head body div class=div div class=inner-div pLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim eniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum. /p /div /div /body /html

Focus on red marked portion. You can see scrollbar. Lets customize this scrollbar.

I used a plugin to customize this scroll bar. You need some files to customize scrollbar.

Now the question is where we can find these  files.

you can download first two files from here:

There are many other files also. you just need those two files. you can download jquery-1.10.2.js from this link:

After added new link in the html file

head titlecreate custom scroll/title link rel=stylesheet type=text/css href=style.css link rel=stylesheet type=text/css href=jquery.mCustomScrollbar.css script type=text/javascript src=jquery-1.10.2.js/script /head

add some scripts at the bottom before end of body tag

!– custom scrollbars plugin — script src=jquery.mCustomScrollbar.concat.min.js/script script (function($) $(window).load(function() $(content_1).mCustomScrollbar( horizontalScroll:true, /*scroll horizontally: boolean*/ ); ); )(jQuery); /script

jquery.mCustomScrollbar.concat.min.js

add some code into CSS files to customize scrollbar

.div position:relative; float:left; width:600 overflow:scroll; overflow-y:hidden; overflow-x:hidden; ner-div position:relative; float:left; width:1000 .mCustomScrollBox height: 192px !important; .mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar background:red !important; .mCSB_dragger width: 52px !important;

.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar

focus on red marked portion. you can see your customized scrollbar.

Date: May 31st, 2017 By Bajlul Haque

NY map is a popular Google term, data shows NYC map is more popular than NY map, our goal is

Date: May 31st, 2017 By Bajlul Haque

See our most recent e-commerce web design template, this theme is ideal to use as a WordPress, Magento, Drupal or

Address: Diamond Bar, California, United States City: Diamond Bar State: California Country: United States User IP: 128.14.129.10 Device Info: Google Chrome ? on windows Referer: From Page: /create-custom-scroll-div/

House 69/2, Road 7/A, 4th Floor (East)