Q:

Can someone help fix my opacity scrolling effect

When i place my div id tag #fading everything seems to fade at once.  I want my parts to fade one by one; individually.  I'm not so skilled at jquery, so some assistance would be great.  

    
        
            
                
            
        
                        
                            
                                
                                        Part 1
                                
                                
                                    Part 2
                                
                                    
                                    Part 3
                                
                                    
                                    Part 4
                                
                                    
                                    Part 5
                                
                        </div>
                    </div>
                    </nav>
                </div>

    <div style="background:white;">
            <div class="row" id="fading" style="padding-left:15%; padding-right:15%;margin-top:100px;">
                <div class="col-xs-8">
                <p><b><em>Part 1:</b></em> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div class="col-xs-4">
                <img src="./photo1.jfif" class="img-responsive ">
            </div>
        </div>

        <div class="row" style="padding-left:15%; padding-right:15%;margin-top:150px;">
                <div class="col-xs-8">
                <p><b><em>Part 2:</b></em> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div class="col-xs-4">
                <img src="./photo2.jpg" class="img-responsive ">
            </div>
        </div>

        <div class="row" style="padding-left:15%; padding-right:15%;margin-top:200px;">
                <div class="col-xs-8">
                <p><b><em>Part 3:</b></em> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div class="col-xs-4">
                <img src="./photo3.jfif" class="img-responsive ">
            </div>
        </div>

        <div class="row" style="padding-left:15%; padding-right:15%;margin-top:250px;">
                <div class="col-xs-8">
                <p><b><em>Part 4:</b></em> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div class="col-xs-4">
                <img src="./photo4.jfif" class="img-responsive ">
            </div>
        </div>

        <div class="row" style="padding-left:15%; padding-right:15%;margin-top:300px;">
                <div class="col-xs-8">
                <p><b><em>Part 5:</b></em> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
            </div>
            <div class="col-xs-4">
                <img src="./photo5.jfif" class="img-responsive ">
            </div>
        </div>
</body>

Here is the script that needs to be fixed or changed.
   <script>
var target = $('#fading');
var targetHeight = target.outerHeight();

$(document).scroll(function(e){
var scrollPercent = (targetHeight - window.scrollY) / targetHeight;
if(scrollPercent >= 0){
    target.css('opacity', scrollPercent);
}
});
</script>

A:

I think this is what you might be after?
http://codepen.io/anon/pen/pJomJY?editors=001
The script is now accounting for the scroll percentage on each .row element :
$(window).scroll(function() {

    var posY = window.scrollY;

    $('.row').each(function(key, item) {

        var target = $(item);
        var topMargin = parseInt(target.css('margin-top'));
        var targetHeight = target.outerHeight(true);
        var targetStart = target.position().top;
        var targetEnd = targetStart+targetHeight;
        var scrollPercent = (targetEnd-posY)/targetHeight;
        scrollPercent = Math.max(0, Math.min(scrollPercent, 1));

        if (posY > targetStart-topMargin) {
            target.css('opacity', scrollPercent);
        }

    });
});

