Change the default values of a javascript library at a common place

180 Views Asked by At

I am using http://rocha.la/jQuery-slimScroll for scrolling. For example:

$('#inner-content-div').slimScroll({
  position: 'right',
  distance: '5px',
  height: '696px',
  railVisible: true,
  color: '#ddd'
});

This kind of code is written at multiple pages, but I want to change some default parameters (for example color, disableFadeOut etc) of the library without changing in the library.

What is the way to do it? Can i extend the library, if yes then, any reference?

1

There are 1 best solutions below

0
On

In this library case, there is no option to change the defaults at global level. I suggest storing the configuration in a common place and reference it in all the pages.