10

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 ?

iCollect.it Ltd
  • 92,391
  • 25
  • 181
  • 202
lior r
  • 2,220
  • 7
  • 43
  • 80
  • Is your code wrapped in a DOM ready event? Is Isotope included after jQuery? Please show more of your page for problems like this. – iCollect.it Ltd 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

3 Answers3

18

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
  • 204
  • 2
  • 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

3

if you use Isotope V2 you should use:

isOriginLeft: false

if you use Isotope V3 you should use:

originLeft: false

originLeft was previously isOriginLeft in Isotope v2. isOriginLeft will still work in Isotope v3. https://isotope.metafizzy.co/options.html#originleft

Nadav
  • 1,730
  • 16
  • 20