我使用此代码运行带有RTL支持的Isotope
$.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'
});
});
由于某种原因,我得到浏览器会返回JavaScript错误
Uncaught TypeError: Cannot read property 'prototype' of undefined
可能是什么原因?
答案 0 :(得分:14)
刚 使用此选项 isOriginLeft:false
和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;
}
答案 1 :(得分:2)
控制布局的水平方向。默认情况下,item元素开始从左侧开始定位,其originLeft:true。设置originLeft:从右到左布局为false。
originLeft: false