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

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -