Skip to content

Instantly share code, notes, and snippets.

@ibanner
Created December 21, 2016 10:29
Show Gist options
  • Save ibanner/2bfd16f757bd9a7c36ffc3bf4473d80a to your computer and use it in GitHub Desktop.
Save ibanner/2bfd16f757bd9a7c36ffc3bf4473d80a to your computer and use it in GitHub Desktop.
Before ALM, this is what I used and worked fine.
var x = document.getElementsByTagName("html")[0].getAttribute("dir");
// console.log(x);
if ( x == 'rtl') {
jQuery('.grid').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-item',
percentPosition: true,
originLeft: false,
resizesContainer: true
});
// console.log('originLeft: false');
} else {
jQuery('.grid').masonry({
itemSelector: '.grid-item',
columnWidth: '.grid-item',
percentPosition: true,
resizesContainer: true
});
// console.log('originLeft: true');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment