I am thinking of using Masonry plugin in one of my projects. What I wonder about if it's possible some way to detect empty spaces that sometimes appear in the layout when divs are positioned. If I had a开发者_Go百科 way to check such blank spaces, I could fill them with some generated divs with some data in them.
I would play with offset().left. For example:
- Store a masonry item in variable "item"
- Check if item.next().offset().left equals item.offset().left+item.outerWidth(true)
That will check if the item next to our starting item is actually there. Note that outerWidth(true) makes sure the margin between items is also counted.
Hope my theory makes sense to you,
Good luck.
精彩评论