Difference between revisions of "Template:AUC TURKEY"

Line 878: Line 878:
 
}( jQuery ));
 
}( jQuery ));
 
     var scroll_pos = 0;
 
     var scroll_pos = 0;
    var animation_begin_pos = 0;
 
    var animation_end_pos = $("body").prop("scrollHeight") - window.innerHeight;
 
console.log(document.body.scrollHeight,window.innerHeight);
 
 
     var beginning_color = new $.Color( 'rgb(255,0,0)' ); //we can set this here, but it'd probably be better to get it from the CSS; for the example we're setting it here.
 
     var beginning_color = new $.Color( 'rgb(255,0,0)' ); //we can set this here, but it'd probably be better to get it from the CSS; for the example we're setting it here.
 
     var ending_color = new $.Color( 'rgb(0,0,255)' );//what color we want to use in the end
 
     var ending_color = new $.Color( 'rgb(0,0,255)' );//what color we want to use in the end
 
     $(document).scroll(function() {
 
     $(document).scroll(function() {
 +
    var animation_begin_pos = 0;
 +
    var animation_end_pos = document.body.scrollHeigh - window.innerHeight;
 
         scroll_pos = $(this).scrollTop();
 
         scroll_pos = $(this).scrollTop();
 
         if(!(scroll_pos < animation_begin_pos || scroll_pos > animation_end_pos) ) {  
 
         if(!(scroll_pos < animation_begin_pos || scroll_pos > animation_end_pos) ) {  

Revision as of 08:50, 28 June 2015