0
好了,所以我要尋找一個類似的功能像我這個頁面上找到:http://jsfiddle.net/B6TZS/做一個jQuery的元素向上滑動,如果另一個被點擊
我需要幾乎同樣的事情。事實上,向下滑動是直接在單擊的元素下。不同之處在於我需要從每個元素的數據中加載某些數據。我希望數據在div滑落時淡入。另外,當點擊一個不同的網格元素時,我希望動畫能夠淡入淡出,並以淡入淡出的方式向下滑動。下面是我的代碼。我越來越掛上如何應用活動類,以及如何確定如何刪除鏈接到過渡動畫的鏈接。
<div class="container leaderShipwrapper gallery-items">
<ul id="items" class="row list-unstyled">
<div class="col-sm-12 col-sm-offset-1 leaderShipgrid">
<li class="col-sm-2 col-xs-4 leader" data-name="joe" data-title="developer" data-profile="profile"><img class="image-responsive" src="images/leader.jpg" alt="" /></li>
<li class="col-sm-2 col-xs-4 leader" data-name="ray" data-title="dunce" data-profile="dunce profile"><img class="image-responsive" src="images/leader.jpg" alt="" /></li>
<li class="col-sm-2 col-xs-4 leader" data-name="joe" data-title="developer" data-profile="profile"><img class="image-responsive" src="images/leader.jpg" alt="" /></li>
<li class="col-sm-2 col-xs-4 leader" data-name="joe" data-title="developer" data-profile="profile"><img class="image-responsive" src="images/leader.jpg" alt="" /></li>
<li class="col-sm-2 col-xs-4 leader" data-name="joe" data-title="developer" data-profile="profile"><img class="image-responsive" src="images/leader.jpg" alt="" /></li>
</div>
<div class="col-sm-10 col-sm-offset-1">
<li id="1" class="leaderDescription"><div class="leaderName"></div><div class="leaderTitle"></div><div class="leaderProfile"></div></li>
</div>
</ul>
</div>
<script>
$('.leaderDescription').hide();
$('.leader').click(function(){
if ($(this).hasClass('active')){
/* hide the next content div*/
$(this).next('.leaderDescription').slideUp();
/* and remove the active class*/
$(this).toggleClass('active');
}
else {
/* slide the content div down */
$(this).next('.leaderDescription').slideDown();
/* and add the active class*/
$(this).addClass('active').slideDown('slow');
}
$(this).parent().siblings().find('.leaderDescription').find('.leaderName').text($(this).attr('data-name'));
$(this).parent().siblings().find('.leaderDescription').find('.leaderTitle').text($(this).attr('data-title'));
$(this).parent().siblings().find('.leaderDescription').find('.leaderProfile').text($(this).attr('data-profile'));
$(this).parent().siblings().find('.leaderDescription').slideDown('slow').addclass('active');
});
</script>
好的,所以我認爲新的問題是與JavaScript。這是當我點擊第一行的第一個框時正在發生的事情的照片。
這是我爲我提供的代碼bootply:'HTTP:// www.bootply.com/R9MD0sFBk8' – user2025730