0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
(function(_){
_.mixin({makeCarouselWidget: function (container, el, width, height, tmpl) {
var list_of_rows = _(container).groupBy(function(e, index){
return Math.floor(index / (width * height));
}); // transform collection to list by 'num_of_cols' chunks
_(list_of_rows).each(function(row){
var list_of_chunks = _(row).groupBy(function(e, index){
return Math.floor(index/width);
});
var li = $('<li>').appendTo(el);
_.each(list_of_chunks, function(chunk){
var r = $('<div>').attr('class','row fooitem')
.attr('style', "margin-right:50px;").appendTo(li);
_.each(chunk, function(item){
r.append(
tmpl.render(item)
);
});
})
}); // each list_of_rows
}});
})(_);
Я хочу быть кочегаром, кочегаром, кочегаром.
Работать сутки-через-трое, через-трое, через-трое...
Запостил:
gueest8 ,
20.01.2019 (Updated 20.01.2019 )
new jQuery('<li>')
http://php.net/manual/ru/language.oop5.magic.php
Но с new будет идиоматичнее, мы же должны работать со свежим экземпляром.
new jQuery скачивает новую версию jQuery?
переписал на IPS*, проверь
*https://en.wikipedia.org/wiki/Image_Packaging_System
https://youtu.be/JyY5kU-RRms
https://youtu.be/vKajqoXTH7k
https://youtu.be/zjqojIjdVuo
https://youtu.be/Ef9s9FK4jWQ
https://youtu.be/5yHsmZy-YS8
https://youtu.be/WlgzamrHD18