GithubHelp home page GithubHelp logo

Comments (5)

daybrush avatar daybrush commented on May 21, 2024 1

@atumas-bananamilk

Since the key is an index, it is difficult to detect size changes if the item has the same key.

Try using the renderItems method every time you search it.

grid.renderItems({ useOrgResize: true });

from egjs-grid.

atumas-bananamilk avatar atumas-bananamilk commented on May 21, 2024

@daybrush

Changing key to image url worked, it now resizes automatically.

There's another problem - before loading all images, it quickly flashes them in their real size before actually fitting into the grid. You can see it happening in the first 3 seconds of the video on the first search.

Is that solvable? I tried with other libraries but don't see the same issue.

from egjs-grid.

daybrush avatar daybrush commented on May 21, 2024

@atumas-bananamilk

It can't be helped because there is time for the image to load.

  1. In the first render, You can hide it by setting position: absolute; left: -9999px; top: -9999px;

  2. If the width x height size can be known in advance, it can be solved.

<img data-grid-width="100" data-grid-height="100" />

from egjs-grid.

atumas-bananamilk avatar atumas-bananamilk commented on May 21, 2024

@daybrush so how do other packages do it? obviously must be something the way you implemented the grid. Thanks anyways!

from egjs-grid.

daybrush avatar daybrush commented on May 21, 2024

@atumas-bananamilk

MasonryGrid, JustifiedGrid FrameGrid, ... works the same in all Grids.

from egjs-grid.

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.