0
目前,我在主頁上有不同的行,每行都有一個按鈕。點擊按鈕後,div將滑動到頁面的頂部。但與此同時,還有另一個操作添加到按鈕。下面是我的js代碼:Onclick slide to current div
$(".expandable-container-mobile").click(function() {
var el = $(this).find('.mobile-show-section');//get the current element
var el2 = $(this).find('.expandable');
el.stop().slideToggle(700);//toggle the current one
$(this).children('.expandable').toggleClass('clicked');
$('.expandable').not(el2).removeClass('clicked');
$('.mobile-show-section').not(el).stop().slideUp();//hide the rest
});
我使用scrollify JS $ .scrollify.move( 「#名字」);但它似乎沒有與div-section-name一起工作,其他方式來實現它也很好。
安置自己的HTML以及所以我們有一個更好的想法是什麼你正在努力 –