Answer the question
In order to leave comments, you need to log in
How to smoothly scroll to jquery anchor?
There are links with anchors and an accordion with text,
For example, there is an item2 link and in the second tab there is id = item2
How
to make it open the desired tab and scroll to the ID when clicking on the link
there are several anchors in one tab, then the first click will open the tab you need and it will be possible to scroll, but if the person then goes up and clicks another link, then the active tab will simply collapse.
I have no idea how to do this.
Answer the question
In order to leave comments, you need to log in
Since no one answered for several hours.
I'll try.
function test(e){
e.preventDefault();
let IdHref = this.getAttribute('href');
let acc = document.querySelector(idHref).closest("ищем ссылку на ваш акардеон");
console.log(acc);
//Ну и активируем чтоб он открылся попробуйте click(); я хз как работает
//Надеюсь проблема была в том чтобы найти нужный аккордеон
}
//Далее думаю разберётесь
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question