Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/11/2008, 14:55
Avatar de hey_alan
hey_alan
 
Fecha de Ingreso: diciembre-2006
Ubicación: México
Mensajes: 348
Antigüedad: 17 años, 4 meses
Puntos: 8
Respuesta: Sumar variable Real en un String

Excelente! me ha servido de maravilla.

Finalmente, de cualquier manera tuve que hacer un switch porque el texto del título no se distinguía entre algunas fotos, así que tuve que agregar distintos valores de color.

Quedó así:

Código:
function ChangeBg(){
if (imgact<4){imgact++;}else{imgact=1;}
stUrl=""; stUrl+="url(imagenes/foto"+imgact; stUrl+=".jpg)";
switch(imgact){
case 2: h2color="#FF9900"; break;
case 3: h2color="#FFFFFF"; break;
case 4: h2color="#990000"; break;
default: h2color="#000000";
}
$('h2').css("background-image" , stUrl);
$('h2').css("color" , h2color);
}
Muchas gracias!
__________________
Alan Marth Media

Diseño web y Publicidad en Morelia, Michoacán