/*! * MOSNE Logo / jQuery Plugin v0.1 * http://www.mosne.it/playground/ * * Copyright 2011, Mosne / Paolo Tesei * Licensed under GPL Version 3 licenses. * http://www.gnu.org/licenses/gpl.html * * Date: 2011-05-30 */ (function($){ $.fn.mosne_logo = function(options) { // plugin's default options var defaults = { txt: Array('MOSNE','WEB','DESIGN'), url: 'http://www.mosne.it', size: 13, txt_c:'#A48599', speed: 500, delay: 1000, colors:[{'c1':'#AD4B74','c2':'#F4767B','c3':'#F8B87F','c4':'#DCD3B4','c5':'#62A1A3'}] }; loop_anim = function (el,j,delay,speed,size,link,txt,a_colors) { if (j===0){ $(el).find('li:even').stop().animate({'margin-top':size},speed); $(el).find('li:odd').stop().animate({'margin-top':0},speed); }else if (j==1){ $(el).find('li:even').stop().animate({'margin-top':0},speed); $(el).find('li:odd').stop().animate({'margin-top':size},speed); }else if (j==2){ $(el).find('li:even').stop().animate({'margin-top':0},speed); $(el).find('li:odd').stop().animate({'margin-top':0},speed); } $(link).html(txt[j]); j++; if (j==3){j=0;} setTimeout(function(){ a_rnd = parseInt(Math.random()*(a_colors.length)); i = 0; $.each(a_colors[a_rnd], function(key, value) { $(el).find("li:eq("+i+")").css({'background-color':value }); i++; }); },delay); setTimeout(function(){loop_anim($(el),j,delay,speed,size,link,txt,a_colors)},delay); } var opt = {} opt = $.extend({}, defaults, options) this.each(function() { var $el = $(this), // reference the jQuery version of the current DOM element el = this, // reference to the actual DOM element c = 0, rnd = parseInt(Math.random()*(opt.colors.length)); var container = $('').css({width:5*opt.size, height: 5*opt.size, 'cursor':'pointer', }).appendTo($el); var colorini = $("