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
:
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>
now i know what you want, so for this you can use following code:
in this case i get first box offset and compare it with other boxes top offset …