Closed codev0 closed 8 years ago
Fixed. But I think add custom function on click event will be useful.
$('.vacancies__tabs').responsiveTabs({
setHash: true
});
if (window.innerWidth <= 768) {
$('.vacancies__tabs').on('tabs-activate', function(event, tab) {
event.preventDefault();
var id = tab.selector;
var link = $(".r-tabs-accordion-title a[href$='" + id + "'].r-tabs-anchor");
var position = 0;
position = link.offset().top - $('.header').outerHeight();
$('html, body').animate({
scrollTop: position + "px"
}, 500);
});
}
Don't think this should have been closed, having this as part of the core plugin would make sense. If there is a lot of content in one tab (activate tab) and not a lot in the next, scrolling down then clicking the next accordion title essentially hides the content from the user making them scroll back up.
Hi. How can I do subj?
This code is work, but event work on page load. How to add this statement to to click event? Or exclude page load?