javascript - Fade out/in two divs at different times on scroll -
basically i'm looking replicate similar effect site: http://www.falve.co.nz/collection/ when scroll down nav fades out pretty quickly, continue scroll hero text gently fades out according scroll position. when scroll top fade in again, hero text first nav.
i'm trying replicate code below not work:
// global vars var $artheaderinner = $('#scene'); var $nav = $('#prim'); var windowscroll; // functional parallaxing calculations function slidingtitle() { //get scroll position of window windowscroll = $(this).scrolltop(); //slow scroll of .art-header-inner scroll , fade out $artheaderinner.css({ 'margin-top' : -(windowscroll/3)+"px", 'opacity' : 1-(windowscroll/550) }); //fade .nav out $nav.css({ 'opacity' : 1-(windowscroll/400) }); }
Comments
Post a Comment