同じ行の別のアイテムが選択されているときに、アイテムの表示スタイルを変更する必要があるプロジェクトに取り組んでいます。また、選択した項目を除く他のすべての項目にオーバーレイを表示する必要があります。jQueryは異なる選択で選択したアイテムスタイルを変更します
現在、私は選択した項目を強調表示してオーバーレイを表示させる作業コードを持っていますが、私の経験の欠如は上記のようにこの作業を行う方法について私に混乱を引き起こしています。参照用のコードは次のとおりです。
$(".prod_link").bind('click', function(){
$(this).find("img").addClass('glow');
$(this).parent().parent().find(".after").css("display", "block");
});
.prod_thumb{height: 100px; width: 100px;}
.prod_thumb:hover{
\t margin: 10px auto;
\t height: 95px;
\t width: 95px;
\t background-color: #cd1041;
\t -webkit-box-shadow: 0px 0px 10px 2px rgba(205, 16, 65, .75);
\t -moz-box-shadow: 0px 0px 10px 2px rgba(205, 16, 65, .75);
\t box-shadow: 0px 0px 10px 2px rgba(205, 16, 65, .75);
\t -webkit-transition: all 0.3s ease-out;
\t -moz-transition: all 0.3s ease-out;
\t -ms-transition: all 0.3s ease-out; /* IE10 is actually unprefixed */
\t -o-transition: all 0.3s ease-out;
\t transition: all 0.3s ease-out;
}
.glow {
\t margin: 5px auto;
\t height: 95px;
\t width: 95px;
\t background-color: #cd1041;
\t -webkit-box-shadow: 0px 0px 10px 2px rgba(205, 16, 65, .75);
\t -moz-box-shadow: 0px 0px 10px 2px rgba(205, 16, 65, .75);
\t box-shadow: 0px 0px 10px 2px rgba(205, 16, 65, .75);
}
.image-container { position: relative; }
.image-container .after { position: absolute; top: 5px; width: 95px; height: 95px; display: block; background: rgba(255, 255, 255, .6); }
.image-container .after:hover{opacity: 0; transition: 0.3s;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<div class="col-sm-2 image-container">
\t <a data-toggle="modal" data-target=".prod_modal" class="prod_link">
\t \t <img src="img/kitchen/cookware2.jpg" class="img-responsive prod_thumb"/>
\t <div class="after" style="display: none;"></div>
</a>
</div>
<div class="col-sm-2 image-container">
\t <a data-toggle="modal" data-target=".prod_modal" class="prod_link">
\t <img src="img/kitchen/cookware3.jpg" class="img-responsive prod_thumb"/>
<div class="after" style="display: none;"></div>
</a>
</div>
<div class="col-sm-2 image-container">
\t <a data-toggle="modal" data-target=".prod_modal" class="prod_link">
\t \t <img src="img/kitchen/cookware4.jpg" class="img-responsive prod_thumb"/>
\t <div class="after" style="display: none;"></div>
</a>
</div>
<div class="col-sm-2 image-container"> \t \t \t \t \t \t \t \t \t
\t <a data-toggle="modal" data-target=".prod_modal" class="prod_link">
\t <img src="img/kitchen/cookware5.jpg" class="img-responsive prod_thumb"/>
\t <div class="after" style="display: none;"></div>
\t </a>
</div>
</div>
すべてのヘルプは大歓迎されます。