单击显示具有指定ID或类的div并淡出所有其他div

时间:2014-03-23 15:28:10

标签: jquery html fadein fade out

我遇到了一个问题,我希望显示所有具有指定类oder id名称的div并隐藏页面上的所有其他div。当我点击

时,这是我的链接
<a href="#" title="Test">Filter Button action</a>


<div id="Test" class="simpleCart_shelfItem item Test" data-ng-repeat="item in items" size-column="" style="margin-bottom: 20px; zoom: 1; opacity: 1;">
        <div class="item_image"><img ng-src="http://paypalinstant.com/images/purse1.jpg" src="http://paypalinstant.com/images/purse1.jpg" style="width: 100%; height: auto; display: block; margin-left: auto; margin-right: auto;"></div>
        <h2 class="item_name ng-binding" ng-bind="item.name">Item Name 1</h2>
        <div class="item_description ng-binding" ng-bind="item.description">The term purse originally referred to a small bag for holding coins. In British English, it is still used to refer to a small coin bag. A "handbag" is a larger needed accessory, that holds items beyond currency, such as a woman's personal items and emergency items to survive on. American English typically uses the terms purse and "handbag" interchangeably. The term "handbag" began appearing in the early 1900s. Initially, it was most often used to refer to men's hand-luggage. Women's accessory bags grew larger and more complex during that period, and the term was attached to the women's accessory.[1] Handbags are used as fashion accessories as well as functional ones.</div>
        <div style="margin-top:10px;">
              <div>  <p style="width:50%; float:left; font-size: 9px; font-weight: bold; margin-bottom: 3px; color: #529092; " class="item_cat ng-binding" ng-bind="item.cat">TEst</p>                 <p style="font-size: 9px; font-weight: bold; margin-bottom: 3px; color: #529092; " class="item_subcat ng-binding" ng-bind="item.subcat">Sonnenbrillen</p>
</div>  
        <button class="item_add btn btn-xs btn-success" style=" margin-top: -8px;  "> In den Warenkorb<i class="fa fa-shopping-cart"></i> </button> 
        <span class="item_price ng-binding" style=" font-size: 23px; margin-bottom: -9px;  "> €99.20</span>
    </div>

在它上面我将拥有所有具有id或类名的Div和#34;测试&#34;出现并淡出其余没有选择div或classname的div。

0 个答案:

没有答案