delarge
4/28/2015 - 9:49 PM

Change opacity on scroll: http://codepen.io/michaeldoyle/pen/Bhsif

Change opacity on scroll: http://codepen.io/michaeldoyle/pen/Bhsif

	var header = $('.desktop #header');
	var range = 350;
	$(window).on('scroll', function () {
	    var st = $(this).scrollTop();
	    header.each(function () {
	        var offset = $(this).offset().top;
	        var height = $(this).outerHeight();
	        offset = offset + height / 2;
	        $(this).css({ 'opacity': 1 - (st - offset + range) / range });
	    });
		});