Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:34:08+00:00 2026-06-08T12:34:08+00:00

I have a grid (3×3) which is 300px and each grid field is 100px

  • 0

I have a grid (3×3) which is 300px and each grid field is 100px wide.

Its very simple to explain if you’ll have a look at jsfiddle here.
Onloads layout isotope its working well, but if you click for example on the li element #2 the grid is going to be resorted, but without using its space correctly.

Why is next to li 3 and empty area? li 4 will fit in there!
Thought isotope will handle this? How to get this?

Thanks for your help!
frgtv10

http://jsfiddle.net/pEZtj/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:34:09+00:00Added an answer on June 8, 2026 at 12:34 pm

    The problem is with your fit order function. When you click on 2 it sets it’s order to 2.5 (index of 1 + 1.5), which is still less than the order of 4 (index of 3). The same thing applies to 3 which has an order of 2.

    To fix this you need a more complex order function. Assuming you only need this to work for four elements the following code should work.

    if(index == 0) { //element 1 should appear first
          order = 0;
    }
    else if ( $item.hasClass('large') && index % 3 == 1 ) {
          order = index + 2.5;
    }
    else if ( $item.hasClass('large') && index % 3 == 2 ) {
          order = index + 1.5;
    }  
    else {
          order = index;
    }
    

    EDIT: To make the code a little prettier and support any size rows you can make the sort function look like this:

    int columns = 3;
    if(index % columns == 0) { //element 1 should appear first
          order = index;
    }
    else if ( $item.hasClass('large')) {
          order = index + columns - (index % columns) + .5;
    } 
    else {
          order = index;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have grid with some textboxes and an image which goes out of grid
I have a grid which I would like to show extra information with RowExpander
I have grid which displays users information. I have commandColumn with edit, delete commands.
I have created a simple grid of divs by left floating them and an
I have a grid view displaying the messages a user has. Each message the
I have a grid with rows that can have same value in NumRow field
I have grid view and now i want to set specific width for each
I have grid view which contains five radio buttons per row. Out of these
I have a grid with 5 cols and 10 rows and in each column
I have a grid (div container) which looks like this: However it's possible that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.