Difference between revisions of "Template:AUC TURKEY"
Line 879: | Line 879: | ||
var scroll_pos = 0; | var scroll_pos = 0; | ||
var animation_begin_pos = 0; | var animation_begin_pos = 0; | ||
− | var animation_end_pos = | + | var animation_end_pos = $("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 | ||
Line 892: | Line 892: | ||
var newBlue = beginning_color.blue() + ( ( ending_color.blue() - beginning_color.blue() ) * percentScrolled ); | var newBlue = beginning_color.blue() + ( ( ending_color.blue() - beginning_color.blue() ) * percentScrolled ); | ||
var newColor = new $.Color( newRed, newGreen, newBlue ); | var newColor = new $.Color( newRed, newGreen, newBlue ); | ||
− | + | console.log( newColor.red(), newColor.green(), newColor.blue() ); | |
$('body').animate({ backgroundColor: newColor }, 0); | $('body').animate({ backgroundColor: newColor }, 0); | ||
console.log("ps"+percentScrolled+" "+animation_end_pos); | console.log("ps"+percentScrolled+" "+animation_end_pos); |
Revision as of 08:46, 28 June 2015