- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
}});
})(_);
                                 
        
            Я хочу быть кочегаром, кочегаром, кочегаром.
Работать сутки-через-трое, через-трое, через-трое...
        
        
new jQuery('<li>')
http://php.net/manual/ru/language.oop5.magic.php
Но с new будет идиоматичнее, мы же должны работать со свежим экземпляром.
new jQuery скачивает новую версию jQuery?
https://youtu.be/JyY5kU-RRms
https://youtu.be/vKajqoXTH7k
https://youtu.be/zjqojIjdVuo
https://youtu.be/5yHsmZy-YS8
https://youtu.be/WlgzamrHD18