Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/12/2016, 15:01
stevens82
 
Fecha de Ingreso: octubre-2011
Mensajes: 132
Antigüedad: 13 años, 6 meses
Puntos: 4
bucle en un plugin jquery

Hola compañeros aca con una consulta espero alguien me ilumine, tengo una libreria para un portafolio la libreria se llama jquery elastic grid, funciona correctamente, ahora los datos lo quiero traer desde la BD y lo traigo con un json y en mi archivo .js tengo el siguiente codigo

Código Javascript:
Ver original
  1. $.ajax({
  2.         url: _root_ + 'index/portafolio',
  3.         type: 'POST',
  4.     }).done(function(data){
  5.         console.log(data);
  6.         var info = JSON.parse(data);
  7.         for(var i in info){
  8.             // $("#elastic_grid_demo").append("<h2> Titulo: " + info[i].titulo, + "</h2>");
  9.             $("#elastic_grid_demo").elastic_grid({
  10.                 'showAllText' : 'All',
  11.                 'filterEffect': 'popup', // moveup, scaleup, fallperspective, fly, flip, helix , popup
  12.                 'hoverDirection': true,
  13.                 'hoverDelay': 0,
  14.                 'hoverInverse': false,
  15.                 'expandingSpeed': 500,
  16.                 'expandingHeight': 500,
  17.                 'items' :
  18.                 [
  19.                     {
  20.                         'title'         : info[i].titulo,
  21.                         'description'   : info[i].descripcion,
  22.                         'thumbnail'     : ['https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg', 'https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg',
  23.                         'https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg',
  24.                         'https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg'],
  25.                         'large'         : ['https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg', 'https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg',
  26.                         'https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg',
  27.                         'https://s-media-cache-ak0.pinimg.com/236x/80/0d/33/800d33f97cff8e8ba296e6d816e5cf14.jpg'],
  28.                         'button_list'   :
  29.                         [
  30.                             { 'title':'Visitar página', 'url' : 'http://porfolio.bonchen.net/', 'new_window' : true },
  31.                             { 'title':'Ver Imagen', 'url':'http://porfolio.bonchen.net/', 'new_window' : true}
  32.                         ],
  33.                         'tags'          : ['Self Portrait']
  34.                     },
  35.                 ]
  36.             });
  37.         }
  38.     });

ese for esta por fuera de la funcion del plugin "elastic_grid()" por lo que me muestra solo uno osea el último, necesito hacer que me muestre todos los datos, alguien tiene alguna idea de como modificar esto?