jqueryjquery-isotope

jQuery Isotope RTL


I'm using this code to run Isotope with RTL support

$.Isotope.prototype._positionAbs = function( x, y ) {
  return { right: x, top: y };
};

$('.portfolio-isotope').each(function() {
    var layoutMode = $(this).attr('data-layoutmode');
    if(!layoutMode || layoutMode === ""){
        layoutMode = 'fitRows';
    }

    $(this).isotope({
        transformsEnabled: false,
        itemSelector: '.portfolio-element',
        layoutMode : layoutMode,
        transitionDuration : '0.8s'
    });

});

For some reason I'm getting the browser returns JavaScript error

Uncaught TypeError: Cannot read property 'prototype' of undefined

What might be the reason for that ?


Solution

  • just use this option isOriginLeft: false

    and css

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