2

ブックマークを初期化するための次のコードがあります

$container.find('.item').wookmark({
            itemWidth: 200,
            offset: 38,
            autoResize: true,
            container: $container
        });

しかし、要素の属性に応じて要素ごとに異なる幅を作りたいので、次のようなものを試しました

...
itemWidth: $(this).attr('imageWidth') ? parseInt($(this).attr(imageWidth)) : 200,
...

しかし、これは「.item」要素を指すのではなく、$containerを指します

4

1 に答える 1