[イメージ説明]WIDTH:600
このようにしたいのですが
下記のように右にスペースができてしまいます。
![イメージ説明]WIDTH:600
lang
1 2img{ 3 max-width: 100%; 4 height: auto; 5 width /****/:auto; /*IE8のみ適用*/ 6} 7 8.wrapper { 9 width: 95%; 10 margin: 3em auto; 11} 12 13.masonry { 14 margin: 1.5em 0; 15 padding: 0; 16 -moz-column-gap: 1.5em; 17 -webkit-column-gap: 1.5em; 18 column-gap: 1.5em; 19 font-size: .85em; 20} 21 22.item { 23 display: inline-block; 24 background: #fff; 25 padding: 1em; 26 margin: 0 0 1.5em; 27 width: 100%; 28 box-sizing: border-box; 29 -moz-box-sizing: border-box; 30 -webkit-box-sizing: border-box; 31 box-shadow: 2px 2px 4px 0 #ccc; 32} 33 34@media only screen and (min-width: 400px) { 35 .masonry { 36 -moz-column-count: 2; 37 -webkit-column-count: 2; 38 column-count: 2; 39 } 40} 41 42@media only screen and (min-width: 700px) { 43 .masonry { 44 -moz-column-count: 3; 45 -webkit-column-count: 3; 46 column-count: 3; 47 } 48} 49 50@media only screen and (min-width: 900px) { 51 .masonry { 52 -moz-column-count: 4; 53 -webkit-column-count: 4; 54 column-count: 4; 55 } 56} 57 58@media only screen and (min-width: 1100px) { 59 .masonry { 60 -moz-column-count: 5; 61 -webkit-column-count: 5; 62 column-count: 5; 63 } 64} 65 66@media only screen and (min-width: 1280px) { 67 .wrapper { 68 width: 1260px; 69 } 70} 71 72body { 73 margin: 0; 74 background: #f9f9f9; 75}
lang
1$(document).on('ready page:change ', function() { 2 var $container = $('.masonry'); 3 $container.imagesLoaded(function() { 4 $('#masonry-container').masonry({ 5 itemSelector: '.item', 6 //isFitWidth: true, 7 8 isAnimated: true, 9 animationOptions: { 10 duration: 400,//デフォルト600 11 easing: 'swing' 12 } 13 }); 14 }); 15 $(function($) { 16 $('.item').hide(); 17 $('.item').each(function(i) { 18 $(this).delay(i * 2).fadeIn(80);//デフォルト1000 19 }); 20 }); 21}); 22//'ready page:load','ready and load'
lang
1<!-- アイテムインデックス --> 2<div class="masonry"> 3 <% @items.each do |item| %> 4 <div class="item"> 5 <% if item.picture_1.present? %> 6 <%= link_to(item) { image_tag item.picture_1_url(:thumb) if item.picture_1? } %> 7 <% else %> 8 <%= link_to(item) {image_tag("opps.jpg", :size => '135x135') } %> 9 <% end %> 10 </div> 11 <% end %> 12</div> 13
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。