Sorting.js - problem with loading images
Hello friend,
i really will appreciate your help about a problem that i have with sorting.js
the code is:
- /* SORTING */
- if (jQuery('.show_album_content').size() > 0) {
- var $container = jQuery('.portfolio_grid_isotope');
- } else if (jQuery('.portfolio_packery').size() > 0) {
- var $container = jQuery('.portfolio_packery');
- }
- jQuery(function () {
- if (jQuery('.show_album_content').size() > 0) {
- $container.isotope({
- itemSelector: '.element'
- });
- } else if (jQuery('.portfolio_packery').size() > 0) {
- $container.isotope({
- itemSelector: '.packery_item',
- percentPosition: true,
- masonry: {
- columnWidth: 1
- }
- });
- }
- if (jQuery('.show_album_content').size() > 0 || jQuery('.portfolio_packery').size() > 0) {
- var $optionSets = jQuery('.optionset'),
- $optionLinks = $optionSets.find('a'),
- $showAll = jQuery('.show_all');
-
- $optionLinks.on('click', function () {
- var $this = jQuery(this);
- // don't proceed if already selected
- if ($this.parent('li').hasClass('selected')) {
- return false;
- }
- var $optionSet = $this.parents('.optionset');
- $optionSet.find('.selected').removeClass('selected');
- $this.parent('li').addClass('selected');
- if ($this.attr('data-option-value') == "*") {
- $container.removeClass('now_filtering');
- } else {
- $container.addClass('now_filtering');
- }
-
- // make option object dynamically, i.e. { filter: '.my-filter-class' }
- var options = {},
- key = $optionSet.attr('data-option-key'),
- value = $this.attr('data-option-value');
- // parse 'false' as false boolean
- value = value === 'false' ? false : value;
- options[key] = value;
- if (key === 'layoutMode' && typeof changeLayoutMode === 'function') {
- // changes in layout modes need extra logic
- changeLayoutMode($this, options)
- } else {
- // otherwise, apply new options
- $container.isotope(options);
- }
- return false;
- });
- }
- });
- jQuery(window).load(function () {
- if (jQuery('.show_album_content').size() > 0) {
- jQuery('.portfolio_grid_isotope').isotope('reLayout');
- } else if (jQuery('.portfolio_packery').size() > 0) {
- $container.isotope('reLayout');
- setTimeout("$container.isotope('reLayout')", 500);
- setTimeout("$container.isotope('reLayout')", 1000);
- }
- });
- jQuery(window).resize(function () {
- if (jQuery('.show_album_content').size() > 0) {
- jQuery('.portfolio_grid_isotope').isotope('reLayout');
- } else if (jQuery('.portfolio_packery').size() > 0) {
- $container.isotope('reLayout');
- setTimeout("$container.isotope('reLayout')", 1000);
- }
- });
when i click on the page of gallery with this sorting script i have this result:
as you can see doesn't load well the images, just a row. The pics are correctly loaded If a refresh the page.
Someone could help me?