0

Featherlight works with no problems but I cannot figure out how to override defaults settings.

I read the documentation, but everything I try does not seems to work. For example, if I want to change openSpeed, what should I write? I am not using the gallery.

Featherlight configuration docs.

Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
Champop
  • 89
  • 1
  • 10

2 Answers2

5

Just modify properties of $.featherlight.defaults, like this:

$.featherlight.defaults.openSpeed = 500;

As @Marc-AndréLafortune pointed, you can override multiple options using $.extend(), like that:

$.extend($.featherlight.defaults, {
  openSpeed: 1000,
  closeSpeed: 1000
});
Michał Perłakowski
  • 88,409
  • 26
  • 156
  • 177
4

You can change the default globally with

$.featherlight.defaults.openSpeed = 1000

For multiple settings, you can of course use:

$.extend($.featherlight.defaults, {
  openSpeed: 1000,
  closeSpeed: 1000
});

Just don't replace the defaults by a different object altogether.

Marc-André Lafortune
  • 78,216
  • 16
  • 166
  • 166