kombai / freewall

Freewall is a cross-browser and responsive jQuery plugin to help you create grid, image and masonry layouts for desktop, mobile, and tablet...
MIT License
1.85k stars 375 forks source link

Handle block resizing when filling gap #99

Closed rapidfixer closed 10 years ago

rapidfixer commented 10 years ago

I use Freewall with parameter fixSize setted to null, by default. Blocks in my grid have inner contents of different size - some are very large, and sometimes block with big image and large amount of content (5x1 places, for example) gets resized to fill in 1x1 place. Can i somehow handle event of block resizing, to change its inner content to get proper look? Can i at least change its class on resize?

kombai commented 10 years ago

I'm sorry, I haven't handle this event yet. But I think it is a fun feature, so I will add it in the next update. Best

kombai commented 10 years ago

Right now you can using this code for handle block resize:

onBlockResize: function(block, setting) {
  console.log(this);
}
rapidfixer commented 10 years ago

Thanks, i am impressed by your response speed. Works as expected, but only one-way: when block gets resized back to its initial state, onBlockResize is not fired.

kombai commented 10 years ago

it is hard to detect resize back to initial state, I think you should do it by manual. The solution is when block resize you store the original width/height and the new width height, then when wall refresh you get them back, compare to know the block revert back to initial state :). Using it on the method onBlockActive

rapidfixer commented 10 years ago

Actually, i thought to manually check width of the blocks after grid rearrange, but it is surely will be better using onBlockActive. Thanks for you help! Your project is looking №1 compared to others that i've tried to use (Nested.js, Masonry, Mason.js).

kombai commented 10 years ago

Thank for used it :)

ZeroBR commented 10 years ago

Hi,

I´m new to programming so be easy on me ok? I'm working in a project with some friends, where we intend to create a website to have images uploaded by users (gifs, webm, etc). I'm trying to understand if frewall can fecth information about files uploaded to our database or if I need to manually feed that info to the plugin.

Thanks a lot!

roobeen commented 8 years ago

hey,

First of all awesome plugin. Second m facing an issue with re-sizing. I am appending data to grid and the grid is coming fine but when i resize window only the preloaded grid gets resized. and the new grid remains the same screenshot from 2016-05-12 04 14 34 .