css - jQuery UI Sortable items in one line should have the same height -
i use jquery ui sortable sort teasers. problem ist, teasers include different amounts of text. (red text.) if there more 1 line of teasers happens: want this: teasers should have same height highest teaser in line. it's no option give them same height. maximum count of teasers per line 3.
is there easier way measuring height of highest teaser per line , adjust height of other teasers jquery after each sort?
$(function () { $('li').addclass('teaser'); $('.sortable').sortable(); $('#fixheights').click(function () { var heights = []; $('.teaser').each(function () { heights.push($(this).height()); }); heights.sort(); var tallest = heights.pop(); alert(tallest); // optional $('.teaser').each(function () { $(this).height(tallest); }) }); });
is there easier way measuring height of highest teaser per line , adjust height of other teasers jquery after each sort?
simply put, no.
Comments
Post a Comment