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

  • SEARCH
  • Home
  • 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 7926343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:44:33+00:00 2026-06-03T18:44:33+00:00

EDIT: carefully! last BOX at the FIRST line! Width of the CONTAINER can CHANGE

  • 0

EDIT: carefully! last BOX at the FIRST line! Width of the CONTAINER can CHANGE at any time. IE. container width 1000px = 10 Boxes per line! Need to select last 10th box at the line. But width of the container can change
:

CHECK EXAMLE

Do you see boxes? ok. need to select last box at the line (8th box) when page is full screen. When browser windows less that 800px – another box will be at the last line possition (ie 7th, 6th, 5th)

======================================

As you see, here is “content div” that contain small boxes. Content div can change own width for user screen resolution at any time. And each “box” will arranged in lines on the screen, but the last box every time willl be different.

How to get ID of the last box on first or second line at the screen with jquery?
Is there any universal methods to get ID from the line of boxes even if the size of content div changed?

Example of initial source:

<style type="text/css">
.box{float: left;
height:100px;
width:100px;
}
.content {
    max-width: 800px;
    width: auto;
    margin: 0 auto;
}
</style>

<div class=content>
<div class=box id=xxx1>xxx</div>
<div class=box id=xxx2>xxx</div>
...
<div class=box id=xxx200>xxx</div>
</div>
  • 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-03T18:44:34+00:00Added an answer on June 3, 2026 at 6:44 pm

    now i know what you want, so for this you can use following code:

    var top = $('.box:first').offset().top; 
    var firstLine = $('.box').filter(function(){
        return $(this).offset().top == top;
    });
    // now you can select any of first line element
    
      firstLine.last(); // Select Last item of first line
      firstLine.eq(3); // box 4
    

    in this case i get first box offset and compare it with other boxes top offset …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT : It turned out that this can only be done through an external
Please read this statement carefully: let's assume before ANY elements are added to the
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT: I was an idiot. I simply had an image that was vertically long,
EDIT: See my answer below--> I am wanting to have a view that when
Edit (updated question) I have a simple C program: // it is not important
EDIT: iam using ajax to load text in my content that is why onload
Edit : Note that, as Daniel and latkin noted in an answer and a
EDIT: Simple version of the question: I want to create server variables in the
EDIT: Here is the edited control file (control.ascx): <%@ Control Language=C# AutoEventWireup=true CodeFile=Sale.ascx.cs Inherits=Enmasse.Modules.Demo_Enmasse.Sale

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.