Currently, I have various rows on the homepage, and each row has a button. When the button is clicked, the div will slide up to the top of the page. But meanwhile, there is another action added to the button as well. Below is my js code:
$( ".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
});
I am using scrollify js $.scrollify.move("#name"); but it doesn't seem to work with the div-section-name, other way to achieve it is fine as well.