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/
You were very close ;)
http://jsfiddle.net/yETC3/1/
@The Doc = FOR THE WIN!
Thanks man, i dont know how i forgot that.
If JSfiddle ever dies and somebody wants to know, this is all that needed to be changed:
$('div').colorspan({ speed:'100' });
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:
This works:
This doesn't work:
Test Case: http://jsfiddle.net/john_motyl/yETC3/
You were very close ;)
http://jsfiddle.net/yETC3/1/
@The Doc = FOR THE WIN!
Thanks man, i dont know how i forgot that.
If JSfiddle ever dies and somebody wants to know, this is all that needed to be changed: