Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/04/2014, 07:39
degrar
 
Fecha de Ingreso: mayo-2012
Mensajes: 19
Antigüedad: 12 años
Puntos: 0
Respuesta: Recargar archivos JS

Phperos, lo que me comentas de ejecutar la funcion lo he probado pero no he tenido suerte.

Lo que he estado investigando es que el pluguin en un inicio funciona, pero una vez se ha ejecutado la funcion para cambiar el contenido del div, deja de funcionar.
Dejo el codigo (ya que lo he sacado de una web de acceso gratuito) que se deberia recargar cada vez que cambio el contenido del div.

Cita:
<script src="libs/jquery.imagesloaded.js"></script>
<script src="jquery.wookmark.js"></script>
<script type="text/javascript">
(function ($){
$('#tiles').imagesLoaded(function() {
// Prepare layout options.
var options = {
autoResize: true, // This will auto-update the layout when the browser window is resized.
container: $('#todo'), // Optional, used for some extra CSS styling
offset: 20, // Optional, the distance between grid items
itemWidth:280, // Optional, the width of a grid item
fillEmptySpace: true // Optional, fill the bottom of each column with widths of flexible height
};

// Get a reference to your grid items.
var handler = $('#tiles li'),
filters = $('#filters li');

// Call the layout function.
handler.wookmark(options);

/**
* When a filter is clicked, toggle it's active state and refresh.
*/
function onClickFilter(e) {
var $item = $(e.currentTarget),
activeFilters = [],
filterType = $item.data('filter');

if (filterType === 'all') {
filters.removeClass('active');
} else {
$item.toggleClass('active');

// Collect active filter strings
filters.filter('.active').each(function() {
activeFilters.push($(this).data('filter'));
});
}

handler.wookmarkInstance.filter(activeFilters, 'or');
}

// Capture filter click events.
$('#filters').on('click.wookmark-filter', 'li', onClickFilter);
});
})(jQuery);
</script>