Botones
Publicado por Drouiz (2 intervenciones) el 30/11/2014 05:42:36
Buenas, estoy diseñando unos botones para redes sociales de una plantilla que ando creando, el problema es que tienen que cambiar de color (azul para facebook, rojo para youtube...) y además cada uno tendrá un texto diferente tipo, síguenos en facebook, visita nuestro canal de youtube. Mi problema es, que no entiendo muy bien el tema del scope y no se como hacer para pasarlo de una funcion a otra os muestro el codigo.
Gracias,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$(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")
);
});
Gracias,
Valora esta pregunta


0