
luisgzafra
Gamma
Programador
¡Usuario con pocos negocios! ¡Utiliza siempre saldo de Forobeta!
Buenas, llevo tiempo con esta función de javascript y no consigo nada.
Lo hice para siguiente tema, si se fijan en Enlace eliminado, click derecho, siguiente imagen. Quiero poner la anterior.
Lo que estoy usando y no funciona es:
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!
Lo hice para siguiente tema, si se fijan en Enlace eliminado, click derecho, siguiente imagen. Quiero poner la anterior.
Lo que estoy usando y no funciona es:
PHP:
function themeHomePrev (theme){
if(empty(getCookie('themeHome'))){
var i = '1';
setCookie('themeHome', '1', 9999999);
} else {
var a = parseInt(getCookie('themeHome'))-1;
var i = a+'';
setCookie('themeHome', a+1, 9999999);
}
if(theme[i] == null){
setCookie('themeHome', '1', 9999999);
home_style(theme['1']['bg'], theme['1']['img'], theme['1']['color'], theme['1']['repeat']);
} else {
home_style(theme[i]['bg'], theme[i]['img'], theme[i]['color'], theme[i]['repeat']);
}
}
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!