我正在使用动画进行页面转换。
说明中有一些我不清楚的地方。
如何为所有超链接应用淡出右效果,而不必为每个链接执行此操作?:
<a href="./page1" class="animsition-link" data-animsition-out-class="fade-out-right" data-animsition-out-duration="2000">
animsition link 1
</a>
这可以由主脚本驱动吗?(我试图用 替换outClass: 'fade-out'
,outClass: 'fade-out-right'
但这不起作用。
按照说明,我这样调用脚本:
$(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; }
});
});