Help with Jquery + Masonry Plugin: How to expand/collapse boxes to reveal content
- by Jam
I'm using the masonry jquery plugin on a project:
(http://desandro.com/resources/jquery-masonry)
Basically I have a set of boxes (thumbnails) in a grid. When one is clicked, I want it to expand to a larger size to show more content (additional images and text). I'm struggling with how to make the thumbnail dissappear and then have new content appear in the expanded box. I don't know how to make the new content appear or where to store it on my page--and it needs to have a close button? The creator of the plugin gave me a quick tip for the expanding part, but the code I'm using has a set height and width and I want them to be variable depending on how much content is in the expanded state.
Here's my jquery code so far:
http://pastie.org/1002101
This is a similar example of the behaviour I want to achieve (except my boxes will have have varying expanded sizes):
(http://www.learnsomethingeveryday.co.uk)
You'll also notice from that example that it only allows 1 box to be expanded at a time--I would also like to have that functionality.
Sorry for all the questions--I'm pretty new to jquery, any help would be amazing!