Giter Site home page Giter Site logo

Comments (8)

desandro avatar desandro commented on July 23, 2024

The Fluid method explained in the Masonry Wiki should allow you to use Isotope in fluid layouts: https://github.com/desandro/masonry/wiki/faq

Also take a look at Chris Armstrong's implementation in his Zootool Inspiration gallery app: http://chris-armstrong.com/inspiration/

from isotope.

shanna avatar shanna commented on July 23, 2024

I can see Chris's example works but it's extremely hard to read. Chris hands over options is subsequent calls to isotope that don't match the options documentation? http://isotope.metafizzy.co/docs/options.html e.g:

isotope({columnWidth: ...})

I'm guessing this option might be getting ignored and the reason he gets away with this is the default outerWidth(true) on the first brick happens to be the same width as all his other bricks?

In my case this isn't true (the first brick spans 2 - 3 columns) so I tried to alter the original columnWidth using the documented format but it silently does nothing. So far the only way I've been able to get it to kinda work is to destroy isotope and fire the constructor again.

$(window).smartresize(function() {
    $container.isotope('destroy').isotope({masonry: {columnWidth: new_width}});
});

from isotope.

desandro avatar desandro commented on July 23, 2024

Looks like this is buggier than I expected. See:

http://jsfiddle.net/desandro/N3PJT/1/

from isotope.

shanna avatar shanna commented on July 23, 2024

Yeah sorry. I didn't know if I was attempting something unsupported, I'd failed to understand the documentation or it was a bug.

I did take a quick peak at the source but it's been a long time since I've written any Javascript and it was obvious I was out of my depth. I figured the columnWidth is being cached somewhere or the options from subsequent isotope() calls aren't being merged in but I got lost trying to follow the widget bridge option stuff.

from isotope.

desandro avatar desandro commented on July 23, 2024

Lemme follow up properly:

Fluid Masonry layout + Isotope can work, but I'm finding a couple bugs:

  • Using items with multiple widths doesn't quite work because jQuery calculates widths with fractions that can throw off the layout algorithm. Try uncommenting .item.w2 { width: 36%; } in the jsFiddle demo to see what I mean.
  • You need to call Isotope twice before it lays out properly. This is a bug, and I'm not sure where its coming from considering it doesn't happen with Masonry.

from isotope.

 avatar commented on July 23, 2024

Hi,

if by Smart Columns you mean something like this - http://www.webappers.com/2009/06/10/autoresizing-smart-columns-with-jquery/ , then I have just come up with a solution for my Isotope project. (code borrowed from the concept of SmartColumns).

$container = $('.isotope');

$container.children().width(Math.floor($container.width() / Math.floor($container.width() / 200)) - parseFloat($container.children().css("margin-right"))+"px")

// the 200px is what I would like my column width to be based upon, expanding and shrinking smartly

$container.imagesLoaded( function(){
$container.isotope({
itemSelector : 'li',
layoutMode : 'masonry',
masonry: {
columnWidth: Math.floor($container.width() / Math.floor($container.width() / 200))
},
resizable : false
});

And put the same code in $(window).smartresize and works like a charm!

from isotope.

desandro avatar desandro commented on July 23, 2024

The Fluid / responsive demo shows the proper technique for this.

from isotope.

 avatar commented on July 23, 2024

Thanks for the answer, but it has 2 issues:

  • it doesn't take "smart" columns into account, it doesn't calculate the number of columns that could fit into the layout and resize the appropriately; it just resizes the columns based on your set number for each container width (making them unreasonably small or large in either case).
  • I had to open Chrome to see what it was actually supposed to look like. Please see my Firefox screenshot for reference: http://imageshack.us/photo/my-images/705/imageshackra.png/

from isotope.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.