$('.slider').slick({
infinite: false,
});
.fancybox-infobar{
display: none;
}
let result = array1.filter((item) => {
return !array2.find((test) => {return test.id === item.id});
});
console.log(result);
window.onbeforeunload = function (evt) {
var message = "Document 'foo' is not saved. You will lost the changes if you leave the page.";
if (typeof evt == "undefined") {
evt = window.event;
}
if (evt) {
evt.returnValue = message;
}
return message;
}
var owl = $('.owl-carousel');
owl.owlCarousel();
// Go to the next item
$('.customNextBtn').click(function() {
owl.trigger('next.owl.carousel');
})
.visible {
visibility: visible !important;
}
var scroll = window.pageYOffset, array = [];
wow.boxes.forEach(function (box) {
let pos = $(box).position(), height = $(box).height();
if (pos.top + height < scroll) {
$(box).addClass("visible");
} else {
array.push(box);
}
});
wow.boxes = array;
$(".each-avatar .avatar").click(function(){
$(this).next().animate({height: 'show'}, 500);
});
$(".each-avatar .info-block").click(function(){
$(this).animate({height: 'hide'}, 500);
});
});
<div class="item">
<img src="http://lorempixel.com/400/300/" alt="">
<div class="wrap-text">
<div>
<h2>Заголовок второго уровня</h2>
<p>Lorem ipsum dolor sit amet, consectetur<br> adipisicing elit. Ipsam, deleniti.</p></div>
</div>
</div>
.wrap-text {
position: absolute;
width: 100%;
top: 13px;
padding: 0 10px;
}
.wrap-text > div {
padding: 10px;
background: red;
}
.item {
position: relative;
float: left;
width: calc(33.33333% - 20px);
margin-right: 20px;
}
var find = function (arr, find) {
return arr.filter(function (value) {
return value === find;
});
};
var arr = ["a", -1, 2, "b"];
console.log(find(arr, -1));
var result = find(arr, 2);
[2]
var find = function (arr, find) {
return arr.filter(function (value) {
return (value + "").indexOf(find) != -1;
});
};
var arr = ["a", -1, 2, "bulka"];
console.log(find(arr, "b"));
var numberInput = document.getElementById("number");
var inputsCount = 0;
numberInput.onchange = function() {
var value = this.value;
if (this.value === 0) {
var last = area.lastChild;
area.removeChild(last);
return;
}
if (value < 0) {
value = 0;
this.value = value;
}
if (value < inputsCount) {
var last = area.lastChild;
area.removeChild(last);
}
if(value > inputsCount){
var inputNew = document.createElement('input');
area.appendChild(inputNew);
}
inputsCount = value;
};
.video_block iframe {
position: relative;
z-index: -1;
}
var jsonObj = {'Account': 'Vasja', 'Date': '02/10/2015', 'Id' : '78234324234'};
var jsonString = JSON.stringify(jsonObj);
console.log(JSON.parse(jsonString.toLowerCase()));
<form id="sendForm">
<input type="text" size="40" name="sub">
<input type="text" size="40" name="text">
<input type="submit" value="GET IT">
</form>
window.addEventListener('DOMContentLoaded', function(){
var form = document.querySelector('#sendForm');
form.addEventListener('submit', function (e) {
e.preventDefault();
sendMail(this.elements.sub.value, this.elements.text.value);
}, false);
}, false);