Difference between revisions of "Team:Dalhousie/test4"

Line 141: Line 141:
  
 
<script>
 
<script>
$(document).ready(function(){      
+
$(document).ready(function(){
            var scroll_pos = 0;
+
    $(document).scroll(function() {
            $(document).scroll(function() {  
+
        var alpha = Math.min(0.5 + 0.4 * $(this).scrollTop() / 210, 0.9);
                scroll_pos = $(this).scrollTop();
+
        var channel = Math.round(alpha * 255);
                if(scroll_pos > 210) {
+
        $(".sticky").css('background-color', 'rgb(' + channel + ',' + channel + ',' + channel + ')');
                    $(".sticky").css('background-color', 'blue');
+
    });
                } else {
+
                    $(".sticky").css('background-color', 'red');
+
                }
+
            });
+
        });
+
 
</script>
 
</script>
  

Revision as of 18:39, 14 September 2017

Welcome to Dalhousie's 2017 iGEM wiki

Sponsor area