Rob
Rob

Reputation: 1505

Animate on scroll once

Im using the fadethis js plugin and trying to make the animate on scroll only happen once, unsure on where im going wrong

http://jsfiddle.net/robcleaton/pLdwdzpz/

JS

$(document).ready(function() {
$(window).fadeThis();
});

Upvotes: 0

Views: 802

Answers (2)

Anubhav
Anubhav

Reputation: 7218

$(document).ready(function() {
    $(window).fadeThis({
        reverse: false;
    });
});

FIDDLE

Upvotes: 1

Callum Linington
Callum Linington

Reputation: 14417

Simple one:

$(window).fadeThis({
    reverse:false
});

The documents specify this to set up the plugin:

<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>

Upvotes: 2

Related Questions