javascript - Getting widths of dynamic float divs -
i building dynamic dropdown navigation.
in dropdown there multiple floating divs, between each 'row of items' have add horizontal divider. can't set static width because text-length of items dynamic , may not wrap.
so reading each container, reading div items, want read width of items add divider can't manage it.
$('.mutopnavdropdown').each(function(i, e) { var iwidth = 0; $(this).find('.mainsubnavrowitem').each(function(ii, ee) { if (iwidth > maxwidth) alert('divide!'); alert($(ee).width() +'-'+ $(ee).offsetwidth +'-'+ $(ee).clientwidth); iwidth += $(ee).width(); }); });
how read floating div no width value , dynamic content inside width?
your code works me. divs visible? if divs set display none jquery not able return width.
Comments
Post a Comment