function getCookie(value) //value==undefined
{ //эта часть пропускается
if(typeof value !== 'undefined' && value !== null) {
return false;
}
}
if(ec.get("id", getCookie(value)) { //и эта тоже
console.log(1);
} else { //вот вывод
console.log(2);
}
<div class="slider">
<div class="item" data-hash="one"><img src="1.jpg"></div>
<div class="item" data-hash="two"><img src="2.jpg"></div>
<div class="item" data-hash="three"><img src="3.jpg"></div>
<div class="item" data-hash="four"><img src="4.jpg"></div>
</div>
<div class="previews">
<a href="#one"><img src="1_prev.jpg"></a>
<a href="#two"><img src="2_prev.jpg"></a>
<a href="#three"><img src="3_prev.jpg"></a>
<a href="#four"><img src="4_prev.jpg"></a>
</div>
$('.slider').owlCarousel({
center:true,
URLhashListener:true,
autoplayHoverPause:true,
startPosition: 'URLHash'
});
$(".item-box").click( function() {
var id = $(this).attr("data-product"),
child = id-1;
$("#pop-up .gallery-cell").hide();
$("#pop-up .gallery-cell").eq(child).show();
$("#pop-up").show();
$("#pop-up").css("z-index",3000000);
$("#all").css({"background-color":"rgba(0,0,0,0.6)", "z-index":15000});
var $body = $(document.body),
$popup = $("#pop-up");
$body.on("mousedown", function () {
$popup.hide();
$("#all").css({"opacity":1,"background":"white"});
$popup.on("mousedown", function (e) {
e.stopPropagation();
});
});
$(".main-gallery").flickity({
cellAlign: 'left',
contain: true,
freeScroll: true,
wrapAround: true,
pageDots: false
});
});
$(".item-box").click( function() {
var id = $(this).attr("data-product"),
child = id-1;
$("#pop-up .gallery-cell").eq(child).show();
console.log($("#pop-up .gallery-cell").eq(child));
$("#pop-up").show();
$("#pop-up").css("z-index",3000000);
$("#all").css({"background-color":"rgba(0,0,0,0.6)", "z-index":15000});
var $body = $(document.body),
$popup = $("#pop-up");
$body.on("mousedown", function () {
$popup.hide();
$("#all").css({"opacity":1,"background":"white"});
$popup.on("mousedown", function (e) {
e.stopPropagation();
});
});
$(".main-gallery").flickity({
cellAlign: 'left',
contain: true,
freeScroll: true,
wrapAround: true,
pageDots: false
});
});
<div id="timer1"></div>
<div id="timer2"></div>
<div id="timer3"></div>
<div id="timer4"></div>
<div id="timer5"></div>
var matches = document.querySelectorAll("div[id^='timer']");
matches.forEach(function(el){
initializeClock(el, deadline);
});
Мне сразу подумалось, что
вы его в CSS выставили.