mercredi 27 janvier 2016

rails 4 justifiedGallery script only load the latest post with images

When i create a new post with images it works, but when i create a new post with images, justifiedGallery doesnt apply the jquery script to the previous post, why?

jQuery -> //when dom is ready
  $("#userindex").justifiedGallery(
    lastRow : 'justify',
    captions: false,
    randomize: false,
    rowHeight: 80,
  )

View to render post with image

<div id="userindex">
   <% img.each do |link| %>
      <div>
          <%= image_tag(link) %>
      </div>
   <% end %>                 
</div>  

Aucun commentaire:

Enregistrer un commentaire