javascript - Count number of rows inside a div element -


as shown in image below, have several div inside div (outer div). need count number of rows outer div have. in example row count 5.

note:the inner div floated left , content created dynamically.

does has ideas?enter image description here

perhaps along lines of:

demo fiddle

var minleft = null, rows = 0; $('div div').each(function () {     var left = $(this).offset().left;     if (left <= minleft || minleft==null) {                 rows++;         minleft=left;     } }); console.log(rows); 

Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -