New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I make mobile show two columns? #212
Comments
What happens if you choose a smaller 'cellW' value? |
i still get only one cell on mobile. i tried with 120 |
Does anyone have an example with mobile and two coluns so I can check what i am doing wrong? |
Hi, cellW: function(container) {
return container.width() / 2;
} You can see the source code of this example: |
I didn't know cellW supports function. I give it a dynamic value according to window.innerWidth. var width = 236;
if (window.innerWidth <= 320) {
width = 120;
} else if (window.innerWidth <= 414) {
width = 150;
} else if (window.innerWidth <= 667) {
width = 200;
}
var currentWidth = window.innerWidth;
$scope.resetWall = function () {
wall.reset({
selector: '.card',
animate: true,
cellW: width,
cellH: 'auto',
onResize: function () {
if (currentWidth !== window.innerWidth)
wall.fitWidth();
}
});
wall.fitWidth();
wall.container.find('.card img').load(function () {
wall.fitWidth();
});
}; Working example at But I feel Kombai's solution is much better. |
@dragonfish-au that good too. Thank you 👍 |
Hi,
I have four columns (width: 25%) and on mobile it shows me only one column.
How can I make mobile show two columns?
var wall2 = new Freewall(".products");
wall2.reset({
selector: '.product',
animate: true,
cellW: 255,
cellH: 'auto',
onResize: function() {
wall2.fitWidth();
}
});
.product {
width: 276.5px;
}
The text was updated successfully, but these errors were encountered: