Skip to content

Instantly share code, notes, and snippets.

@Grawl
Forked from anonymous/gist:f4ea6caec051f99d7dd6
Last active February 1, 2016 07:02
Show Gist options
  • Save Grawl/9be1f1eb72b1cf0aa3e5 to your computer and use it in GitHub Desktop.
Save Grawl/9be1f1eb72b1cf0aa3e5 to your computer and use it in GitHub Desktop.
//с alert работает без alert нет
$(document).ready(function() {
var color;
var i = 0;
function col(i) {
color = "rgb(255," + i +',' + i + ")";
$('#y1').css('background-color', color);
}
function fade(){
i = i + 10;
alert (i);
setTimeout (col(i), 100);
if (i <= 255) {
return fade ();
};
}
$('#lens').on('click', function() {
if ($('#y1').val('')) {
fade ();
i = 0;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment