Simple Parallax effect

This is just a simple parrallax effect, that doenst use bloated plugins

by Gopinath Kaliappan

HTML

<a href="https://stackexchange.com/users/7119817/vicky-smart"><img src="https://stackexchange.com/users/flair/7119817.png" width="208" height="58" alt="profile for Vicky Smart on Stack Exchange, a network of free, community-driven Q&amp;A sites" title="profile for Vicky Smart on Stack Exchange, a network of free, community-driven Q&amp;A sites" /></a>
<div class="scroll">
     <h1>Text on parralax background</h1>
     <div class="scroll">
     <img src="https://www.workspace.com/images/trace.png" />
       <h1>Text on parralax background</h1>
    </div>
    
    
</div>
<div class="scroll">
       <h1>Text on parralax background</h1>
    </div>
<a href="http://bjornnyborg.com" target="blank">By Bjørn Nyborg</a>

CSS

.scroll {
     /*Set a css background */
    background:url(https://efficiosolutions.com/wp-content/uploads/2013/01/Business-Workspace-PC-and-Laptop-Work-Vector-Pack-PNG-Graphic-Cave-e1449492253449.png) fixed;
    
    /*Dont mind the rest*/
    width:100%;
    height:300px;
    line-height:300px;
    margin:0 auto;
    margin-top:150px;
    text-align:center;
    color:black;
    font-family:'Open Sans' sans-serif;
}
body {
    min-height:3000px;
}
a {
    margin-top:20px;
    display:block;
    text-align:center;
    text-decoration:none;
    font-family:'Open Sans' sans-serif;
    color:#666;
    -webkit-transition:opacity .5s;
    transition:opacity .5s;
}
a:hover {
     -webkit-transition:opacity .5s;
    transition:opacity .5s;
    opacity:.5;
}
/*------------------*/

JavaScript

//Parallax 
function simpleParallax() {
    //This variable is storing the distance scrolled
    var scrolled = $(window).scrollTop() + 1;

    //Every element with the class "scroll" will have parallax background 
    //Change the "0.3" for adjusting scroll speed.
    $('.scroll').css('background-position', '0' + -(scrolled * 0.3) + 'px');
}
//Everytime we scroll, it will fire the function
$(window).scroll(function (e) {
    simpleParallax();
});