L
L
lavezzi12015-05-15 05:18:56
css
lavezzi1, 2015-05-15 05:18:56

How to continue animation when switching between tabs?

Hello.
I screwed the animation to the site jackonthe.net/css3animateit . There are several tabs on the page with this js code

$(document).ready(function () {
  $('.accordion-tabs-minimal').each(function(index) {
    $(this).children('li').first().children('a').addClass('is-active').next().addClass('is-open').show();
  });
  $('.accordion-tabs-minimal').on('click', 'li > a.tab-link', function(event) {
    if (!$(this).hasClass('is-active')) {
      event.preventDefault();
      var accordionTabs = $(this).closest('.accordion-tabs-minimal');
      accordionTabs.find('.is-open').removeClass('is-open').hide();

      $(this).next().toggleClass('is-open').toggle();
      accordionTabs.find('.is-active').removeClass('is-active');
      $(this).addClass('is-active');
    } else {
      event.preventDefault();
    }
  });
});

The problem is that elements that are inside tabs need animation, but when switching from one tab to another, the animation does not work (it's understandable, it's animate as you scroll).
What needs to be done to make the animation work when switching tabs without scrolling?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question