3

I'm adding a comment section to each of the 'tiles' which are displayed using the wookmark jquery plug-in.

This can be either a comment box or, a comment box and previous comments, therefore height unknown.

As there are multiple I'm adding them in after the fact.

The problem is that that comment field is loaded under each image but the tiles are not updating their size to fit, therefore they are overlapping, the comments are laying over the tiles below them.

I understand I can refresh the layout but just don't know where, have tried every where I can think of.

This is the code to load the comments (Each <LI> has a div named .comment_holder at the bottom of it)

/** Refreshes the layout. */
function applyLayout() {

    $('.comment_holder').each(function(index, elem){
       $(elem).load('/pages/includes/comments.php', { 
            wl_id: $(elem).attr("id") 
        });
    });

  // Clear our previous layout handler.
  if(handler) handler.wookmarkClear();
  // Create a new layout handler
  handler = $('#tiles li');
  handler.wookmark(options);

};

Any ideas?

Pradeep
  • 3,258
  • 1
  • 23
  • 36
StudioTime
  • 22,603
  • 38
  • 120
  • 207

1 Answers1

0

Maybe you'd better to give a test link on jsfiddle.com. To make sure to do the layout after all the doms are rendered, you should move the wookmark method into the callback function of $(elem).load.

Jack Hu
  • 1,315
  • 2
  • 13
  • 27