Installation
Step 1: Link required files
<link rel="stylesheet" href="../dist/css/animsition.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="../dist/js/animsition.min.js"></script>
Step 2: HTML markup
<body>
<div class="animsition">
<a href="./page1" class="animsition-link">animsition link 1</a>
<a href="./page2" class="animsition-link">animsition link 2</a>
</div>
</body>
If you want each "linkElement" to use a different animation.
<a
href="./page1"
class="animsition-link"
data-animsition-out-class="fade-out-right"
data-animsition-out-duration="2000"
>
animsition link 1
</a>
<a
href="./page2"
class="animsition-link"
data-animsition-out-class="rotate-out"
data-animsition-out-duration="500"
>
animsition link 2
</a>
If you want to each page to use a different animation.
<div
class="animsition"
data-animsition-in-class="flip-in-x"
data-animsition-in-duration="1000"
data-animsition-out-class="flip-out-x"
data-animsition-out-duration="800"
>
...
</div>
Step 3: Call the animsition
$(document).ready(function() {
$(".animsition").animsition({
inClass: 'flip-in-x',
outClass: 'flip-out-x',
inDuration: 1500,
outDuration: 800,
linkElement: '.animsition-link',
loading: true,
loadingParentElement: 'body',
loadingClass: 'animsition-loading',
loadingInner: '',
timeout: false,
timeoutCountdown: 5000,
onLoadEvent: true,
browser: [ 'animation-duration', '-webkit-animation-duration'],
overlay : false,
overlayClass : 'animsition-overlay-slide',
overlayParentElement : 'body',
transition: function(url){ window.location.href = url; }
});
});
Example