What have I done wrong? It worked before I separated the methods as suggested in the jquery docs.
Calling: $(this).Slick('show');
(function ($) {
var methods = {
// object literals for methods
init: function (options) {
// initialize settings
var settings = $.extend({
'location': 'center',
'speed': 'normal'
}, options);
},
show: function () {
return this.each(function () {
// plugin code here
alert('success!');
});
},
hide: function () {
// hide
}
};
$.fn.Slick = function (method) {
// method calling logic -- jquery recommended / standard
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments 1));
} else if (typeof(method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error('Method ' + method + ' does not exist on jQuery.Slick');
}
};
})(jQuery);
There are two syntax errors.
Missing comma:
Missing closing parenthesis: