Giter Site home page Giter Site logo

Comments (6)

desandro avatar desandro commented on May 28, 2024

Here you go: http://jsfiddle.net/Tjp7a/6/ I am using destroy method to disable Packery.

from packery.

 avatar commented on May 28, 2024

That is amazing. Thank you so much!

from packery.

 avatar commented on May 28, 2024

Hi David,

I am noticing some strange behavior when making your example slightly more complex.

If you re-size the browser smaller and then full screen again some of the items do not get positioned correctly, some go off screen

http://jsfiddle.net/trewknowledge/Tjp7a/12/

This issue does not happen if you do not use the re-size function

http://jsfiddle.net/trewknowledge/LYAMN/1/

however, the items get arranged when the page loads (expected result).

Any thoughts?

P.S. Do you offer paid support?

from packery.

amirkhan81 avatar amirkhan81 commented on May 28, 2024

Thank you for this!

from packery.

desandro avatar desandro commented on May 28, 2024

See better answer at #135 (comment)

from packery.

tomsabin avatar tomsabin commented on May 28, 2024

We can use matchMedia to make this more efficient. See the following example for Packery to be disabled on mobile, but enabled on tablet and larger:

if (Modernizr.matchmedia) {
  var mq  = matchMedia('(min-width: 660px)');
  var $container = $('[data-packery-target]');
  var packeryOptions = {
    itemSelector: '.item'
  };

  if (mq.matches) {
    $container.packery(packeryOptions);
  }

  mq.addListener(function(mql) {
    if (mql.matches) {
      $container.packery(packeryOptions);
    } else {
      $container.packery('destroy');
    }
  });
}

Support is decent: http://caniuse.com/#feat=matchmedia

from packery.

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.