Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/04/2014, 08:11
Avatar de Eleazan
Eleazan
 
Fecha de Ingreso: abril-2008
Ubicación: Ibiza
Mensajes: 1.879
Antigüedad: 16 años
Puntos: 326
Respuesta: Recargar archivos JS

Perdón, contesté muy rapidito....


Prueba con este código:
Código Javascript:
Ver original
  1. (function ($){
  2.  
  3. // Prepare layout options.
  4. var options = {
  5. autoResize: true, // This will auto-update the layout when the browser window is resized.
  6. container: $('#todo'), // Optional, used for some extra CSS styling
  7. offset: 20, // Optional, the distance between grid items
  8. itemWidth:280, // Optional, the width of a grid item
  9. fillEmptySpace: true // Optional, fill the bottom of each column with widths of flexible height
  10. };
  11.  
  12. // Get a reference to your grid items.
  13. var handler = $('#tiles li'),
  14. filters = $('#filters li');
  15.  
  16.  
  17. $('#tiles').imagesLoaded(function() {
  18.  
  19. // Call the layout function.
  20. handler.wookmark(options);
  21.  
  22. /**
  23. * When a filter is clicked, toggle it's active state and refresh.
  24. */
  25. function onClickFilter(e) {
  26. var $item = $(e.currentTarget),
  27. activeFilters = [],
  28. filterType = $item.data('filter');
  29.  
  30. if (filterType === 'all') {
  31. filters.removeClass('active');
  32. } else {
  33. $item.toggleClass('active');
  34.  
  35. // Collect active filter strings
  36. filters.filter('.active').each(function() {
  37. activeFilters.push($(this).data('filter'));
  38. });
  39. }
  40.  
  41. handler.wookmarkInstance.filter(activeFilters, 'or');
  42. }
  43.  
  44. // Capture filter click events.
  45. $('#filters').on('click.wookmark-filter', 'li', onClickFilter);
  46. });
  47. })(jQuery);

Así, las variables "options", "handlers" y "filters" serán globales (accesibles para cualquier trozo de código de js).

Una vez comprobado que así funciona, al recargar tu div, supongo que usarás alguna función en plan $.ajax, o cosas.... puedes volver a ejecutar esta linea:
Código Javascript:
Ver original
  1. handler.wookmark(options);
__________________
>> Eleazan's Source
>> @Eleazan