Isotope filter animating from random position

I have Isotope set up with filters but when a filter is clicked my Isotope items animate from what appears to be a random position. You can see it in action here – http://ccmac.iamphiljames.co.uk/whats-on/events/

Has anyone got any idea why and how I can fix this?

Read More

Here is my isotope call –

  jQuery(window).load(function() {
      var $container = jQuery('.grid');
      $container.isotope({
          itemSelector: '.grid-item',
          percentPosition: true,
          masonry: {
              // use element for option
              columnWidth: '.grid-sizer'
          },
          filter: '*',
          animationOptions: {
              duration: 750,
              easing: 'linear',
              queue: false
          },
      });

      $container.isotope({
          getSortData: {
              name: function($elem) {
                  return $elem.find('time').attr('data-time');
              }
          },
          sortBy: 'name',
          sortAscending: true,
      });

And here is my filter –

      jQuery('.filters-button-group a').click(function() {
          jQuery('.filters-button-group .current').removeClass('current');
          jQuery(this).addClass('current');

          var selector = jQuery(this).attr('data-filter');
          $container.isotope({
              filter: selector,
              animationOptions: {
                  duration: 750,
                  easing: 'linear',
                  queue: false
              }
          });

          return false;
      });
  });

I am using Events Manager plugin in WordPress which uses shortcode to create a post loop, here is the filter HTML and events list

echo '<div class="button-group filters-button-group">
            <h4>Filter by:</h4>
            <div class="buttonsInner">
                <a href="#" class="button current" data-filter="*">All</button>
                <a href="#"  class="button" data-filter=".Standard">Standard</button>
                <a href="#" class="button" data-filter=".Bandstand">Bandstand</button>
            </div>
            <div style="clear:both;"></div>
        </div>';

echo "<div class='css-events-list grid'>";

echo do_shortcode( '[events_list scope="all" order="DESC" category="-32"]

        <article class="grid-sizer grid-item eventOuter #_CATEGORYNAME">
            <div class="eventInner">
                #_EVENTIMAGE{my_custom_size}
                <div class="eventListInfo">
                    <h1 class="eventListTitle">#_EVENTLINK</h1>
                    <data class="date" data-time="#{Y-m-d}">#_{d M Y} #@_{- d M Y} </data>
                    <p>#_EVENTEXCERPT{12,...} <a href="#_EVENTURL">Event details</a></p>
                </div>
            </div>
        </article>
[/events_list]' );

and my CSS –

.grid { position:relative; }
.grid-sizer,
.grid-item { width: 33.3333%; }

h1.eventListTitle { 
  font-size: 2em;
  line-height: 1.3em;
  margin-top: 0;
  margin-bottom: 0.7em;
}

.grid-item {
  z-index: 2;
}

.isotope-hidden.grid-item {
  pointer-events: none;
  z-index: 1;
}

.grid, .grid .grid-item {
  -webkit-transition-duration: 0.8s;
  -moz-transition-duration: 0.8s;
  -ms-transition-duration: 0.8s;
   -o-transition-duration: 0.8s;
      transition-duration: 0.8s;
}

.grid {
  -webkit-transition-property: height, width;
  -moz-transition-property: height, width;
  -ms-transition-property: height, width;
   -o-transition-property: height, width;
      transition-property: height, width;
}

.grid .grid-item {
   -webkit-transition-property: -webkit-transform, opacity;
   -moz-transition-property:    -moz-transform, opacity;
   -ms-transition-property:     -ms-transform, opacity;
   -o-transition-property:      -o-transform, opacity;
      transition-property:         transform, opacity;
}

Related posts