简体   繁体   中英

White Space with Isotope plugin when expanding boxes, what to do?

I have this content area, build with the isotope plugin: http://jsfiddle.net/B2Erk/

The content consists of 10 boxes equally sized.

When the boxes with "Number 3, Number 4, Number 7 and Number 8" is pressed they expands to the right. This results in the box that has been clicked, moves to the row below and leaves whitespace to the row above (see fiddle).

Is it possible making the boxes (Number 3, Number 4, Number 7 and Number 8) to open to the left and make it so there is no white space?

This also needs to work when scaling down.

The code used to expand the boxes:

// change size of clicked element
  $container.delegate( '.item', 'click', function(){
    $(this).toggleClass('large');
    $container.isotope('reLayout');
  });

Yeap, this is very much possible with a custom layout .

You can see an example of this running at this test site where all the items are flush along the right hand edge - the (unminified) js code for that layout is here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM