DrewDahlman / Mason

Mason.js for creating a perfect grid with jQuery.
http://masonjs.com/
MIT License
1.22k stars 183 forks source link

Creating a fixed corner stamp? #44

Closed daniellecs closed 9 years ago

daniellecs commented 9 years ago

This is awesome. How would you create a fixed corner stamp? (i.e. a div that is 'promoted' (so always has same dimensions) but always stays on the top-left corner of the mason gallery layout?). I've played around a bit but haven't found a perfect solution. Thanks.

DrewDahlman commented 9 years ago

This is a good question and one that I have actually done! It's really easy actually but will take a little messing with. The idea would be to give a special ID or class to that specific div ( it should also still have the promoted piece that is in Mason ) before you call mason you will want to remove it and prepend it to your grid then call mason. This will force it into the desired position.

daniellecs commented 9 years ago

Works perfectly; I also just realized that I could have put this stamp element as the first element in the collection and would do the same thing, since that's what remove/prepend is doing. Thanks for your speedy answer.

DrewDahlman commented 9 years ago

:+1: