Ver Mensaje Individual
  #6 (permalink)  
Antiguo 06/04/2012, 11:26
Maru77
 
Fecha de Ingreso: agosto-2003
Mensajes: 524
Antigüedad: 20 años, 8 meses
Puntos: 5
Respuesta: Cómo pasar de php a array de javascript

lo intenté así, si bien no me arroja ningún error no me muestra la imagen

Código HTML:
<script type="text/javascript">

var img = new Array(); 
var img = <?=json_encode($imagen)?>;

var mygallery=new simpleGallery({
wrapperid: "simplegallery", //ID of main gallery container,
dimensions: [1280, 510], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
imagearray: [

["img[1]", "", "", ""],
["img[2]", "", "", ""]

],
...
}
es necesario que ubique las imagenes de este modo, ya que es así como funciona el script.

Código HTML:
imagearray: [

["img[1]", "", "", ""],
["img[2]", "", "", ""]

],
__________________
Saludos!!!
Maru.-