Im having trouble calling my speed for my plugin. The code following is not the extent of my plugin, it is just for testing.
Basic Plugin:
(function($) {
$.fn.colorspan = function(options) {
var settings = {
speed: 800
};
if (options) {
$.extend(settings, options);
}
function testFunction() {
$('div').append("Howdy folks
");
}
timer = setInterval(function() {
testFunction();
}, settings.speed);
};
})(jQuery);
This works:
$('div').colorspan();
This doesn’t work:
$('div').colorspan(speed:'100');
Test Case: http://jsfiddle.net/john_motyl/yETC3/