var els = [];
[].forEach.call(document.querySelectorAll('.list .el'),function(item){
if(item.querySelectorAll('.ad').length != 1){
els.push(item)
}
})
console.log(els)
(function(error,callback){
var random = Math.floor(Math.random()*2001);
var res = setTimeout(function(){
clearTimeout(rej)
callback(random)
},random);
var rej = setTimeout(function(){
clearTimeout(res)
error(new Error(random))
},1000);
})(function(num){
console.log(num)
},function(error){
console.log(error)
})
(function(){
return new Promise(function(resolve, reject){
var random = Math.floor(Math.random()*2001);
setTimeout(function(){
resolve(random)
},random);
setTimeout(function(){
reject(new Error(random))
},1000);
});
})()
.then(function(result){
console.log(result)
})
.catch(function(error){
console.log(error)
})
_.flatten([1, [2], [3, [[[4]]]]]);
// вернёт [1, 2, 3, 4]
_.flatten([1, [2], [3, [[4]]]], true);
// вернёт [1, 2, 3, [[4]]]
var gulp = require('gulp');
gulp.task('default', function() {
gulp.src("./*.css")
.pipe(gulp.dest('./'));
gulp.watch('./*.js', function(event) {
console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');
});
});
body {
height: 100vh;
}
В любом случаи необходимо смотреть поддержкуhtml, body, .container {
height: 100%;
}
Если не задать html {height: 100% }, то body {height:100%} не имеет смыслаfunction setHeiHeight() {
$('#hei').css({
height: $(window).height() + 'px'
});
}
setHeiHeight(); // устанавливаем высоту окна при первой загрузке страницы
$(window).resize( setHeiHeight ); // обновляем при изменении размеров окна
Думаю что Коментарии тут не требуются for(i=0; i<3; i++) /* проверка строк */
if(matrix[i][0]==matrix[i][1] &&
matrix[i][0]==matrix[i][2]) return matrix[i][0];
for(i=0; i<3; i++) /* проверка столбцов */
if(matrix[0][i]==matrix[1][i] &&
matrix[0][i]==matrix[2][i]) return matrix[0][i];
/* проверка диагоналей */
if(matrix[0][0]==matrix[1][1] &&
matrix[1][1]==matrix[2][2])
return matrix[0][0];
if(matrix[0][2]==matrix[1][1] &&
matrix[1][1]==matrix[2][0])
return matrix[0][2];