Freewall pinterest布局不起作用

时间:2014-12-11 13:15:49

标签: javascript jquery pinterest

我正在尝试使用布局pinterest但不成功:

用法:

var wall = new freewall("#pinterest");
wall.reset({
    selector: '.pin',
    cellW: 200,
    cellH: 'auto',
    onResize: function() { return wall.fitWidth(); }
});

return wall.container.find('.pin img').load(function() {
    return wall.fitWidth();
});

以下示例:http://jsfiddle.net/1kbpkh80/1/

1 个答案:

答案 0 :(得分:0)

Dont change the selector class as .pin keep this .brick
    <script type="text/javascript">
                var wall = new freewall("#pinterest");
                wall.reset({ 
                    selector: '.brick',
                    cellW: 200,
                    cellH: 'auto',
                    onResize: function() {
                        wall.fitWidth();
                    }
                });

                wall.container.find('.brick img').load(function() { 
                    wall.fitWidth();
                });

    </script>

For refrence check this link http://vnjs.net/www/project/freewall/example/pinterest-layout.html