Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/01/2012, 05:02
luisgzafra
 
Fecha de Ingreso: noviembre-2010
Mensajes: 1.242
Antigüedad: 13 años, 5 meses
Puntos: 73
Error con función javascript

Buenas, llevo tiempo con esta función de javascript y no consigo nada.

Lo hice para siguiente tema, si se fijan en www.tuentimp3.com, click derecho, siguiente imagen. Quiero poner la anterior.

Lo que estoy usando y no funciona es:

Código Javascript:
Ver original
  1. function themeHomePrev (theme){
  2.     if(empty(getCookie('themeHome'))){
  3.         var i = '1';
  4.         setCookie('themeHome', '1', 9999999);
  5.     } else {
  6.         var a = parseInt(getCookie('themeHome'))-1;
  7.         var i = a+'';
  8.         setCookie('themeHome', a+1, 9999999);
  9.     }
  10.    
  11.     if(theme[i] == null){
  12.         setCookie('themeHome', '1', 9999999);
  13.         home_style(theme['1']['bg'], theme['1']['img'], theme['1']['color'], theme['1']['repeat']);
  14.     } else {
  15.         home_style(theme[i]['bg'], theme[i]['img'], theme[i]['color'], theme[i]['repeat']);
  16.     }
  17.    
  18. }

theme es un array, está definido
theme['1'] = new array();
theme['1']['bg'] = 'algo';

theme['2'] = NULL;
etc

probé a pasarlo por theme, invocando themeHomePrev(theme); pero no funciona

la cookie themeHome tiene un número, la id de la imagen.

Espero que vean el fallo que yo no vi,
Saludos!
__________________
:)