smart-create,
focus
var that = $({
input: $('[name=btn]'),
index: 0
})
.delay(1000)
.queue(function check(next) {
that.delay(5000)
.queue(check);
*!*
if (this.input.is(':focus'))
return that.stop();
*/!*
this.input
.eq(this.index < this.input.length ? this.index++ : this.index = 0)
.prop('checked', true);
next();
});
hover
var that = $({
input: $('[name=btn]'),
index: 0
})
.delay(1000)
.queue(function check(next) {
that.delay(5000)
.queue(check);
*!*
if (this.input.is(function(){ return $(this).is(':hover') }))
return that.stop();
*/!*
this.input
.eq(this.index < this.input.length ? this.index++ : this.index = 0)
.prop('checked', true);
next();
});