Forked from anonymous/gist:f4ea6caec051f99d7dd6
Last active
February 1, 2016 07:02
-
-
Save Grawl/9be1f1eb72b1cf0aa3e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//с 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