Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/11/2014, 22:53
Drouiz
 
Fecha de Ingreso: noviembre-2014
Mensajes: 6
Antigüedad: 9 años, 5 meses
Puntos: 0
Busqueda Scope en Jquery

Os comento, ando creando unos botones para redes sociales, estos tienen un color gris y si pasas el ratón encima cambia cada a uno a su color (face azul, youtube rojo...) y aparece un texto encima (siguenos, +1...) el problema que no me reconoce las variables color y texto en la función que he creado.

Código:
$(document).ready(function(){
  
 			function socialbottons(drbottom, socialcolor, socialtype){
				$(drbottom).hover(
					function(){
						console.log(socialcolor)
						$( this ).css( "color", socialcolor);
						var socialchange = "<span style='color: " + socialcolor +  "'>"+socialtype+"  </span>";
						$( "#dr-contact").html( socialchange);
						$( this ).animate({
							"fontSize": "40px"
							}, 200 );
					},function(){
						$( this ).animate({
							"fontSize": "28px"
							},200);
						$( "#dr-contact").html("Contact us </span>" );
						$( this ).css( "color", "");
					}
				)
				$(drbottom).click(
					function(){
						$( this ).css( "color", "red");
						$( this ).fadeOut( 0 );
						$( this ).fadeIn( 500 );
					}
				)
			};
				
			$( "#dr-facebook" , "blue"," facebook" ).hover(
				socialbottons("#dr-facebook")
			);
			
			$( "#dr-twitter", "blue"," folow us" ).hover(
				socialbottons("#dr-twitter")
			);

			$( "#dr-linkedin", "blue"," linkedin"  ).hover(
				socialbottons("#dr-linkedin")
			);
			
			$( "#dr-google", "red"," +1"  ).hover(
				socialbottons("#dr-google")
			);
			
			$( "#dr-youtube", "red"," canal de youtube" ).hover(
				socialbottons("#dr-youtube")
			);
			
			
			$( "#dr-mail" , "green"," send us a mail").hover(
				socialbottons("#dr-mail")
			);
  
});
Muchas gracias