https://gist.github.com/biojazzard/f96ae350c628fafac41e
A Pen by Alfredo Llanos on CodePen.
<h2 class="text-center">El boton naranja se volverá verde a los 2 segundos.</h2> | |
<div id="rober" class="btn btn-warning btn-block"> | |
ROBER | |
</div> | |
<p class="text-center">Actualizar para repetir el efecto.</p> |
### | |
# alfredo@1un.es | 02.2015 | |
### | |
(($) -> | |
# Variables | |
config = | |
welcome: '############# 1un.es #############' | |
# Functions | |
# Di Hola! | |
init = ()-> | |
# Log in console that we´re ready to rock!. | |
console.log config.welcome | |
# Quitar la clase btn-success y poner | |
visual = ()-> | |
$('#rober').toggleClass 'btn-warning' | |
$('#rober').toggleClass 'btn-success' | |
# Do it!. | |
init() | |
# A los 2 seg=== 2000ms lanza visual() | |
setTimeout -> | |
visual() | |
, 2000 | |
) jQuery |
.roberized { | |
} |