Authored by biao

add wraper only when there is enough elements to wrap. code review by LZF

... ... @@ -50,9 +50,13 @@ function hiddenTips($ele) {
//}
function wrapElements(selector, count) {
var elArr = null;
$(selector).each(function(idx, el) {
if (idx % count === 0) {
$($(selector).slice(idx, idx + count)).wrapAll($('<div class="js-wraper"></div>'));
elArr = $(selector).slice(idx, idx + count);
if (elArr.length === count && idx % count === 0) {
$(elArr).wrapAll($('<div class="js-wraper"></div>'));
}
});
}
... ...