Skip to content Skip to sidebar Skip to footer

Content.toggleanimationclass(); Is Not A Function

I have the html and css working fine with the most basic use of smoothState.js ;(function ($) { $('#main').smoothState(); })(jQuery); However even with this basic implementation

Solution 1:

I dealt with this exact same issue. If you download the demo's and go through their 'functions.js' you'll notice a different way of handling the exiting css class. Here is that code, have tested it and it works for me.

$(function(){
  'use strict';
  var$page = $('#main'),
      options = {
        debug: true,
        prefetch: true,
        cacheLength: 2,
        forms: 'form',
        onStart: {
          duration: 250, // Duration of our animation
          render: function ($container) {
            // Add your CSS animation reversing class$container.addClass('is-exiting');
            // Restart your animation
            smoothState.restartCSSAnimations();
          }
        },
        onReady: {
          duration: 0,
          render: function ($container, $newContent) {
            // Remove your CSS animation reversing class$container.removeClass('is-exiting');
            // Inject the new content$container.html($newContent);
          }
        }
      },
      smoothState = $page.smoothState(options).data('smoothState');

});

Solution 2:

I think that method is removed, not to restart animation try

content.restartCSSAnimations()

Post a Comment for "Content.toggleanimationclass(); Is Not A Function"