By default, jQuery.extend() compares only the immediate properties, performing a "shallow merge". Since both objects have background , it just takes all background from the second object.
But pass a true as the first argument, and jQuery.extend() will do a deep merge.
slider.settings = $.extend(true, slider.settings, options);
Also, since 1st Object is target and will be changed and return 'd, you can only update slider.settings with
$.extend(true, slider.settings, options);
And, if you prefer to have a new Object from a merge, you will have to create it yourself:
slider.settings = $.extend(true, {}, slider.settings, options);
source share