[英]Onclick slide to current div
當前,主頁上有各行,每行都有一個按鈕。 單擊該按鈕時,div將向上滑動到頁面頂部。 但是與此同時,按鈕上還添加了另一個操作。 以下是我的js代碼:
$( ".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(“#name”); 但它似乎不適用於div-section-name,也可以通過其他方法來實現。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.