我正在使用fadethis js插件并试图让滚动动画只发生一次,不确定我哪里出错了
http://jsfiddle.net/robcleaton/pLdwdzpz/
JS
$(document).ready(function() {
$(window).fadeThis();
});
答案 0 :(得分:2)
简单的一个:
$(window).fadeThis({
reverse:false
});
文档指定这个来设置插件:
<script>
$(document).ready(function() {
$(window).fadeThis({
baseName: "slide-",
speed: 500, // <a href="http://www.jqueryscript.net/animation/">Animation</a> speed in milliseconds.
easing: "swing", // Animation easing.
offset: 0, // <a href="http://www.jqueryscript.net/tags.php?/Scroll/">Scroll</a> offset, allowing to fire fading a little after or before the element appear.
reverse: true, // Make element disappear again when scrolled out, and fade again when scrolled in.
distance: 50, // Element distance to its emplacement, before animation.
scrolledIn: null, // Function to call when the element come in viewport.
scrolledOut: null // Function to call when the element go out of the viewport.
});
});
</script>
答案 1 :(得分:1)
$(document).ready(function() {
$(window).fadeThis({
reverse: false;
});
});
<强> FIDDLE 强>