Open adaniello opened 7 years ago
Hi @adaniello
Thanks for amazing suggestion. I will do my research and check how much code does it require to add on top of current code base. If it won't break my mental rule of "lightweight and simple carousel" I will add it :-)
Thanks again and have a great day 🥑
@pawelgrzybek in my opinion best way should be something as follow:
mergeSettings()
extend()
this.config
in constructor
as extend()
of default settings, custom options and data attributes.With
function extend() {
for(var i=1; i<arguments.length; i++)
for(var key in arguments[i])
if(arguments[i].hasOwnProperty(key))
arguments[0][key] = arguments[i][key];
return arguments[0];
}
Another way, faster should be adding another "for" cycle in mergeSettings
in settings
to check if data attribute exists and isn't empty (!this.selector.getAttribute(attrname)
) and so set this value in settings
object.
These are only ideas.
Thanks
Great ideas! I'll check all available options, I'll do a research how people smarter than myself do it and then I will come back to you. I'll try to do it this week. Thanks again for great suggestion.
Thank you for your great project!
No problemmooo! I'm glad that you found it useful :)
This is only an idea, something as follow
Normally, this is how works a good jQuery plugin by using
$.extend()
but it's good also for a pure Javascript as Siema is 😄