Показать сообщение отдельно
  #17 (permalink)  
Старый 13.12.2016, 13:44
Профессор
Отправить личное сообщение для Rise Посмотреть профиль Найти все сообщения от Rise
 
Регистрация: 07.11.2013
Сообщений: 4,662

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();
});
Ответить с цитированием