I want to call this function (makes an element to blink), declared as a separate file:
(function($) {
$.fn.cyclicFade = function(options)
{
if (typeof(options) == 'string') {
if (options=='stop') {
$(this).stop(true);
return this.each(function() {
$(this).data('cyclic-fade').enabled = false;
});
}
else return null;
}
else {
var opts = $.extend({}, $.fn.cyclicFade.defaults, options);
return this.each(function() {
$(this).data('cyclic-fade', {enabled : true});
$.fn.cyclicFade.doCycle(this,1,opts.repeat,opts.params,0);
});
}
};
}
(it's not complete, space matters)
when I click a div called .swatch. How do I invoque the function?
$(document).ready(function() {
$(".swatch").click(function () {
// .swatch starts to blink
});
});
Thanks in advance.