Reputation: 225
okay i making a jQuery plugin to make a slide down menu on click, everything works on it but when i try to pass my own options it ignores them help please?
http://jsfiddle.net/y5kC6/2/ theres is a jsfiddle so you can get a better thought of what i mean.
Upvotes: 1
Views: 45
Reputation: 6221
You didn't set up your function to receive passed parameters.
Change it to something like this...
$.fn.plugin = function(options) {
var defaults = {
speed: 500,
margin: '-40px',
};
if(options) {
$.extend(defaults,options);
}
Upvotes: 1
Reputation: 190952
you don't have any named parameters.
change
$.fn.plugin = function()
to
$.fn.plugin = function(options)
Upvotes: 1