JavaScript
- 9 ответов
- 0 вопросов
3
Вклад в тег
<input type="text" id="timer" value="25">
var timer = document.getElementById("timer"),
minuteWork = timer.value;
function asc() {
timer.value = (parseInt(minuteWork) + 1);
}
// Строка 33
var tl = new Date('2020/01/01 00:00:00');
(function(day, hour, min, sec, callbackInterval, callbackEnd) {
var resultInSeconds = ((new Date).getTime() / 1000) + ((day * 24 * 60 * 60) + (hour * 60 * 60) + (min * 60) + sec),
dhm = function(t) {
var cd = 24 * 60 * 60 * 1000,
ch = 60 * 60 * 1000,
d = Math.floor(t / cd),
h = Math.floor((t - d * cd) / ch),
m = Math.floor((t - d * cd - h * ch) / 60000),
s = Math.round((t - d * cd - h * ch - m * 60000) / 1000);
if (m === 60) {
h++;
m = 0;
}
if (h === 24) {
d++;
h = 0;
}
return [d, h, m, s];
},
interval = setInterval(function() {
var now = (new Date()).getTime() / 1000;
if (now >= resultInSeconds) {
callbackEnd.call(window);
clearInterval(interval);
return;
}
callbackInterval.apply(window, dhm((resultInSeconds - now) * 1000));
}, 1000);
})(
1, // дни
2, // часы
3, // минуты
40, // секунды
// вызывается каждую секунду
function(days, hours, minutes, seconds) {
console.log(arguments);
},
// вызывается в конце
function() {
console.log('Время вышло!');
}
);
/***
* Основной слайдер
***/
.primary-slider {
margin-bottom: 32px;
width: 960px;
margin: 0 auto 32px;
position: relative;
}
/* Меню разделов */
.primary-slider .catmenu {
position: relative;
background: #faf9ef;
background: rgba(250, 249, 239, 0.95);
z-index: 999;
}
.primary-slider .catmenu ul {
height: 60px;
position: relative;
}
.primary-slider .catmenu ul li {
float: left;
padding: 22px 0px 23px;
font-size: 13px;
text-transform: uppercase;
position: relative;
}
.primary-slider .catmenu ul li div.level1 {
border-bottom: 1px solid #faf9ef;
border-right: 1px solid #faf9ef;
}
.primary-slider .catmenu ul li div.level1 div.subLevel1 {
position: relative;
}
.primary-slider .catmenu ul li:first-child {
margin-left: 0;
}
.primary-slider .catmenu ul li a {
display: inline-block;
line-height: 15px;
color: #66786d;
text-decoration: none;
}
.primary-slider .catmenu ul li a:hover {
text-decoration: underline;
}
.primary-slider .catmenu ul li:hover {
background-color: #fff;
}
.primary-slider .catmenu ul li:hover div.level1 {
display: block !important;
position: absolute;
top: 60px;
left: 0;
background-color: #fff;
padding: 20px;
width: 215px;
box-shadow: 5px 5px 30px gray;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1:hover div.level2 {
z-index: 10000;
display: block !important;
position: absolute;
top: -10px;
left: 180px;
background-color: #fff;
padding: 20px;
width: 215px;
}
.primary-slider .catmenu ul li div.level1 div.subLevel1 div.level2 p {
border-bottom: 1px solid #e1e1e1;
padding: 20px 0;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1:hover div.level2 p:first-child {
padding-top: 0px;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1:hover div.level2 p:nth-last-child(1) {
padding-bottom: 0px;
border-bottom: none;
}
.primary-slider .catmenu ul li div.level1 div.subLevel1 img {
margin: -3px 0 0 15px;
}
.primary-slider .catmenu ul li div.level1 div.subLevel1 div.level2 {
border: 1px solid #e1e1e1;
}
.primary-slider .catmenu ul li:last-child div {
left: auto;
right: 0;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1 {
border-bottom: 1px solid #e1e1e1;
padding: 20px 0;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1.sub {
padding-bottom: 0;
padding-left: 15px;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1:first-child {
padding-top: 0px;
}
.primary-slider .catmenu ul li:hover div.level1 div.subLevel1:nth-last-child(1) {
padding-bottom: 0px;
border-bottom: none;
}
/* Галерея */
.primary-slider .gallery {
position: relative;
height: 534px;
margin-bottom: -60px;
top: -60px;
overflow: hidden;
}
.primary-slider .gallery .slides {}
.primary-slider .gallery .slides .slide {
float: left;
position: relative;
}
.primary-slider .gallery .slides .slide img {
display: block;
width: 960px;
height: 534px;
}
.primary-slider .gallery .slides .slide .legend {
position: absolute;
right: 99px;
top: 207px;
}
.primary-slider .gallery .slides .slide .legend .bg {
background-color: #000;
background-color: rgba(0, 0, 0, 0.8);
}
.primary-slider .gallery .slides .slide .legend .content {
max-width: 330px;
}
.primary-slider .gallery .slides .slide .legend .caption {
padding: 8px 10px;
font-size: 24px;
line-height: 28px;
}
.primary-slider .gallery .slides .slide .legend .caption .title, .primary-slider .gallery .slides .slide .legend .caption .title a {
color: #edddb1;
}
.primary-slider .gallery .slides .slide .legend .caption .price {
color: #cdc82a;
}
.primary-slider .gallery .slides .slide .legend .caption .price s {
color: #4c4c3f;
}
.primary-slider .gallery .slides .slide .legend .desc {
margin-top: 1px;
padding: 8px 10px;
font-size: 11px;
color: #b9b19b;
}
.primary-slider .gallery .slides .slide .legend .cart {
float: right;
margin-top: 1px;
padding: 0 14px 0 55px;
font-size: 21px;
color: #cdc82a;
line-height: 47px;
text-decoration: none;
background-image: url('../images/slider-to-cart.png');
background-repeat: no-repeat;
background-position: 14px center;
}
.primary-slider .gallery .slides .slide .legend .cart span {
border-bottom: 1px dotted;
}
.primary-slider .gallery .slides .slide .legend .cart:hover span {
border-bottom: 0;
}
.primary-slider .gallery .pages {
position: absolute;
left: 0;
bottom: 17px;
width: 100%;
height: 17px;
text-align: center;
}
.primary-slider .gallery .pages a {
display: inline-block;
width: 15px;
height: 15px;
margin: 0 1px;
text-align: left;
text-indent: -9999px;
border: 1px solid #c5c02a;
border-radius: 2px;
}
.primary-slider .gallery .pages a.selected {
background: #c5c02a;
}
.primary-slider .gallery .nav {
position: absolute;
top: 0;
width: 50px;
width: 100%;
height: 100%;
/*background: url('../images/slider-nav.png') no-repeat 0 217px;*/
background-color: rgba(255, 255, 255, 0.4);
background-repeat: no-repeat;
}
.primary-slider .gallery .nav:hover {
background-color: rgba(255, 255, 255, 0.2);
}
.primary-slider .gallery .nav-prev {
right: 50%;
margin-right: 430px;
background-position: right 277px;
}
.primary-slider .gallery .nav-next {
left: 50%;
margin-left: 430px;
background-position: left 277px;
}
.primary-slider .gallery .nav-prev:hover {
background-position: right 277px;
}
.primary-slider .gallery .nav-next:hover {
background-position: left 277px;
}
.primary-slider .gallery .nav-prev:active {
background-position: right 278px;
}
.primary-slider .gallery .nav-next:active {
background-position: left 278px;
}
.primary-slider .gallery .nav-prev {
background-image: url(data:image/png;base64,);
}
.primary-slider .gallery .nav-prev:hover {
background-image: url(data:image/png;base64);
}
.primary-slider .gallery .nav-next:hover {
background-image: url(data:image/png;base64);
}