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

Popular posts from this blog

mongodb - Struggling to get ordered results from the last retrieved article, given array of elements to search in -

c# - Pausing a storyboard on TabItem mouse over -

c# - Attribute value in root node of xml Linq to XML -