Animation triggers

1 reply · opened Jul 19, 2016

AannaweaverJul 19, 2016

Hi there. I bought this theme yesterday and getting on pretty well with it (great product) but I am just wondering whether there is a way of changing the animation triggers? By default they seem to be triggered as soon as they come into view on scroll. I actually want them to trigger when the element gets to the top of the window. I have used Skrollr in the past to achieve this.

If not, I have written some jquery to do it (though not sure this is the best way), but now wondering where to put it. Should it go the functions.js?

Here is the code I have currently:

    allSections = $('.scroll-section');
    allSections.css('opacity','0');
    $window = $(window);
    fadeSection();		

	function fadeSection(){
		$(".scroll-section").each(function(){
			var distance = $(this).position().top;
	    	if ( $window.scrollTop() >= distance - 100 ) {
	        	// Your div has reached the top
	        	//allSectionIDs.push(this.id, offset.top);
	    	 	$(this).stop().animate({
				    opacity: 1
				  }, 500, function() {
				    // Animation complete.
				});
	        	console.log($(this).attr("id") + " has reached the top");
		    }
		    else{
	    	 	$(this).stop().animate({
				    opacity: 0
				  }, 500, function() {
				    // Animation complete.
				});			    	
		    }
		});			
	}

	$window.scroll(function() {
		fadeSection();
        });
SSemicolon WebSTAFFJul 21, 2016

Hello,

Thank You so much for the Kind Words. :)

Yes currently the Animation on Reveal Feature comes into play for the Related Element as soon as it gets displayed on the Screen. But since you intend to use a Custom Code to reveal the Elements, you can simply add your Code at the bottom of the js/functions.js File.

This will definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard
Animation triggers · Canvas Template Support