0

I'm using animsition for page transitions.

There is something that I'm not clear with in the instructions.

How can I apply a fade-out-right effect for everything hyperlink without having to do this for each link? :

<a href="./page1" class="animsition-link" data-animsition-out-class="fade-out-right" data-animsition-out-duration="2000">
  animsition link 1
</a>

Can this be driven by the main script? (I have tried to replace outClass: 'fade-out' by outClass: 'fade-out-right', but that does not work.

As per the instructions, I call the script like that:

$(document).ready(function() {
  $(".animsition").animsition({
    inClass: 'fade-in',
    outClass: 'fade-out',
    inDuration: 1500,
    outDuration: 800,
    linkElement: '.animsition-link',
    // e.g. linkElement: 'a:not([target="_blank"]):not([href^=#])'
    loading: true,
    loadingParentElement: 'body', //animsition wrapper element
    loadingClass: 'animsition-loading',
    loadingInner: '', // e.g '<img src="loading.svg" />'
    timeout: false,
    timeoutCountdown: 5000,
    onLoadEvent: true,
    browser: [ 'animation-duration', '-webkit-animation-duration'],
    // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser.
    // The default setting is to disable the "animsition" in a browser that does not support "animation-duration".
    overlay : false,
    overlayClass : 'animsition-overlay-slide',
    overlayParentElement : 'body',
    transition: function(url){ window.location.href = url; }
  });
});
Greg
  • 2,937
  • 9
  • 47
  • 96

1 Answers1

1

just started messing with animsition a couple days ago. I think this may be what you need to do:

Set the fade-out (or fade-in) classes in the ".js-animsition .animsition" div wrapping the elements on the page you want effected. If you do this, your link elements only need to be given the ".aninmsition-link" class to trigger the effects.

<nav> <a href="./page1" class="animsition-link">some link</a> <a href="./page2" class="animsition-link">some link</a> </nav>

<div class="js-animsition animsition" data-animsition-in-class="fade-in-up" data-animsition-out-class="fade-out-right" data-animsition-out-duration="300" style="animation-duration:300ms;">

some content you want to fade in from the bottom on page entrance and fade out to the right on page exit

</div>

hope this helps a bit. my first forum answer thingy!

tealicious
  • 11
  • 4