9

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 ?

Gone Coding
  • 88,305
  • 23
  • 172
  • 188
lior r
  • 2,020
  • 6
  • 38
  • 78
  • Is your code wrapped in a DOM ready event? Is Isotope included after jQuery? Please show more of your page for problems like this. – Gone Coding Jun 17 '14 at 09:49
  • It is wrapped inside DOM ready event. isotope is included after jQuery and without "$.Isotope.prototype._positionAbs = function( x, y )" It is working fine only on LTR mode – lior r Jun 17 '14 at 09:59

2 Answers2

17

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;
}
Ziaeecs
  • 194
  • 1
  • 3
3

Controls the horizontal flow of the layout. By default, item elements start positioning at the left, with originLeft: true. Set originLeft: false for right-to-left layouts.

originLeft: false

isotope options