因此,我的頁面上有一個切換塊,現在我需要在同一頁面上添加另一個切換塊,但默認情況下第一個切換爲活動/打開。 我一直在JS的周圍工作,但目前爲止沒有運氣,所以我需要你寶貴的幫助才能使這個工作。 謝謝!默認情況下第一個切換打開
的Javascript
jQuery(window).load(function(){
$('.toggle-view li').click(function() {
var text = $(this).children('div.toggle-content');
if (text.is(':hidden')) {
text.slideDown('200');
$(this).children('span').html('<i class="icon-minus"></i>');
} else {
text.slideUp('200');
$(this).children('span').html('<i class="icon-plus"></i>');
}
$(this).toggleClass('activetoggle');
});
});
我喜歡說_block of tedggles_所以我會盡力幫忙。 – struthersneil
哈哈。謝謝;) – Tiago
http://codepen.io/anon/pen/IrobD這是你需要什麼? – struthersneil