Не работает полоса загрузки и шаг в quiz?
На нажатие кнопки назад полоса загрузки и шаг не уменьшаются? Почему?
$(document).ready(function() {
$('.step-slide__title').each(function(index, el) {
$(el).prepend('<div class="step-slide__title-counter">' + (index + 1) + '</div>');
});
for (var i = 0; i < $('.step-slide').length - 1; i++) {
$('.step__extender').append('<div class="step__extender-item"></div>');
};
var progress = {
current: ( 100 / ($('.step-slide').length - 1) ),
total: $('.step-slide').length,
width: ( 100 / ($('.step-slide').length - 1) ),
process: doProgress
};
function doProgress () {}
var testSlider = $('.test-slider').bxSlider({
mode: 'horizontal',
infiniteLoop: false,
speed: 700,
adaptiveHeight: true,
adaptiveHeightSpeed: 0,
touchEnabled: false,
pager: false,
prevSelector: '.btn-prev-container',
prevText: '<div class="btn-prev">Назад</div>',
nextSelector: '.btn-next-container',
nextText: '<div class="btn-next">на следующий шаг</div>',
onSliderLoad: function (currentIndex) {
// первоначальные стили
$('.main-progress__text').eq(currentIndex).addClass('main-progress__text_active');
$('.main-progress__sales').eq(currentIndex).addClass('main-progress__text_active');
$('.step__extender-item').eq(currentIndex).addClass('step__extender-item_active');
$('.main-progress__extender').css('width', progress.width + '%');
},
onSlideAfter: function (slideElement, oldIndex, newIndex) {
// активация кнопок
$('.btn-next-container').removeClass('btn-next-container_active');
$('.btn-next').removeClass('btn-next_active btn-shine');
// изменение полосы загрузки
progress.current += progress.width;
$('.main-progress__extender').css('width', progress.current + '%');
// изменение шага
$('.step__extender-item').eq(newIndex).addClass('step__extender-item_active');
$('.step__text span').html(newIndex + 1);
// изменение заголовка в полосе загрузки
if ( $('.main-progress__text').eq(newIndex).length != 0 ) {
$('.main-progress__text').eq(oldIndex).removeClass('main-progress__text_active');
$('.main-progress__text').eq(newIndex).addClass('main-progress__text_active');
};
// изменение заголовка в полосе загрузки
if ( $('.main-progress__sales').eq(newIndex).length != 0 ) {
$('.main-progress__sales').eq(oldIndex).removeClass('main-progress__text_active');
$('.main-progress__sales').eq(newIndex).addClass('main-progress__text_active');
};
}
});
$('.pick-item__input').on('change', function(event) {
event.preventDefault();
$('.btn-next-container').addClass('btn-next-container_active');
$('.btn-next').addClass('btn-next_active btn-shine');
});
});
.video-link {
display: none;
}
.main-progress__sales {
border: 5px solid #fbd232;
margin-top: 5px;
padding: 0px 0px 0px 10px;
float: right;
line-height: 1.4;
display: none;
}
.main-progress__sales i {
float: left;
text-align: left;
border-right: 2px solid #fbd232;
padding-right: 10px;
font-style: normal;
font-weight: bold;
font-size: 20px;
display: block;
line-height: 46px;
color: red;
}
.main-progress__sales span {
font-size: 12px;
display: inline-block;
text-align: right;
width: 70px;
border-bottom: 2px solid #fbd232;
padding-right: 5px;
}
.main-progress__sales b {
font-size: 20px;
text-align: right;
display: inline-block;
width: 70px;
line-height: 1;
padding: 3px 5px 0 0;
}
.btn-next { background: #eee;
line-height: 3;
color: #999;
display: block;
text-align: center;
transition: .3s;
position: relative;
overflow: hidden;
text-transform: uppercase;
border-radius: 2px;
padding: 0 10px;
height: 45px;
}
.btn-next i {
line-height: 1.8;
}
.btn-next_active { background: #fbd232; color: #000; box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2); }
.btn-next-container {
width: 50%;
position: relative;
text-align: right;
padding-right: 10px;
}
.btn-next-container::before {
content: "";
display: inline-block;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 5;
cursor: not-allowed;
max-width: 285px;
margin: 0 auto;
}
.btn-next-container_active:before { content: none; }
.btn-prev-container { width: 50%; position: relative; }
.bx-prev {
background: #fbd232;
color: #000;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
line-height: 3;
display: block;
text-align: center;
transition: .3s;
position: relative;
overflow: hidden;
text-transform: uppercase;
border-radius: 2px;
max-width: 165px;
margin-left: 15px;
padding: 0 10px;
}
.btn-shine:after { content: ""; margin-left: 60px; width: 30px; height: 300px; background: rgba(255,255,255,0.1); -webkit-animation-delay: 0.05s; animation-delay: 0.05s; position: absolute; left: -40px; top: -150px; -webkit-animation-timing-function: ease-in-out; animation-timing-function: ease-in-out; -webkit-transition: all 0.1s; transition: all 0.1s; -webkit-animation-name: slideme; animation-name: slideme; -webkit-animation-duration: 3s; animation-duration: 3s; -webkit-animation-iteration-count: infinite; animation-iteration-count: infinite; -webkit-transform: rotate(45deg); transform: rotate(45deg); }
@-webkit-keyframes slideme { 0% { left: -30px; margin-left: 0px; }
30% { left: 110%; margin-left: 80px; }
100% { left: 110%; margin-left: 80px; } }
@keyframes slideme { 0% { left: -30px; margin-left: 0px; }
30% { left: 110%; margin-left: 80px; }
100% { left: 110%; margin-left: 80px; } }
.bx-next { display: inline-block; width: 100%; max-width: 285px; }
.bx-prev:hover, .bx-next:hover {text-decoration: none;color: #000;}
.portable-test-wrapper { background: #FFF; position: relative; }
.header-line {
padding: 1px 0;
background: #fbd232;
color: #000;
text-transform: uppercase;
text-align: center;
}
.header-line__title {
font-size: 18px;
line-height: 1.33;
font-weight: 300;
margin: 10px 0;
}
.progress-line {
clear: both;
margin-top: 5px;
}
.main-progress { background: #F2F2F2; position: relative; }
.main-progress__extender { position: absolute; top: 0; left: 0; bottom: 0; max-width: 100%; height: 100%; background: #fbd232; -webkit-transition: .3s; transition: .3s; }
.main-progress__text {
position: relative;
width: 100%;
padding: 10px;
font-size: 17px;
text-align: center;
display: none;
border: 5px solid #fbd232;
}
.main-progress__text_active { display: block; }
.step { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: nowrap; flex-wrap: nowrap; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; margin: 20px auto 30px; }
.step__text { font-size: 14px; margin-right: 15px; }
.step__extender { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: nowrap; flex-wrap: nowrap; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; position: relative; }
.step__extender:after { content: ""; display: block; width: 100%; height: 1px; background: #fbd232; position: absolute; top: 50%; left: 0; right: 0; }
.step__extender-item { width: 9px; height: 9px; border: 1px solid #fbd232; border-radius: 50%; background: #FFF; margin-right: 15px; position: relative; z-index: 2; }
.step__extender-item:last-child { margin-right: 0; }
.step__extender-item_active { background: #fbd232; }
.step-title {
display: block;
width: 100%;
text-align: left;
padding: 10px 20px;
margin: 10px 0 20px;
font-weight: 300;
font-size: 18px;
color: #777;
border-left: 3px solid #fbd232;
}
.step-slide { padding-bottom: 55px; }
.step-slide__discount {
font-size: 16px;
font-weight: bold;
margin: -25px 0 40px 15px;
}
.step-slide__title, .step-slide__title2 { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: nowrap; flex-wrap: nowrap; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; font-size: 24px; font-weight: bold; margin-bottom: 30px; }
.step-slide__title2 {
margin-left: 50px;
}
.step-slide__title-counter {
color: #000;
width: 45px;
height: 45px;
border-radius: 50%;
font-size: 22px;
line-height: 2;
margin-right: 15px;
background: #fbd232;
text-align: center;
}
.step-slide__grid { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-pack: start; -ms-flex-pack: start; justify-content: flex-start; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; padding-left: 35px; }
.pick-item { font-size: 16px;
background: #fbd232;
color: #fff;
line-height: 1;
display: block; width: 20%; margin: 0 1% 30px; cursor: pointer; position: relative;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
border-radius: 2px;
min-height: 119px;
text-align: center;
padding-bottom: 14px;
}
.pick-item span {
padding-top: 75px;
display: block;
color: #000;
}
.pick-item__img { width: 100%; height: 140px; overflow: hidden; margin-bottom: 5px; text-align: center; }
.pick-item__img img { display: inline-block; width: 100%;
height: 130px;
border-radius: 2px 2px 0 0;
}
.pick-item__input {
opacity: 0;
position: absolute;
}
.pick-item__input:checked + .pick-item__label:after {
content: "check";
display: block;
width: 40px;
height: 40px;
background: #fff;
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
color: #444;
font-family: 'Material Icons';
box-shadow: 0 2px 2px 0 rgb(0 0 0 / 14%), 0 1px 5px 0 rgb(0 0 0 / 12%), 0 3px 1px -2px rgb(0 0 0 / 20%);
}
.pick-item__label {
font-size: 32px;
line-height: 1.2;
position: absolute;
top: 25%;
left: 50%;
margin-left: -20px;
display: block;
}
.pick-item__label::before {
content: "check";
display: block;
width: 40px;
height: 40px;
background: rgba(255,255,255,0.8);
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
font-family: 'Material Icons';
color: #fbd232;
}
.podarok .pick-item {
width: 100%;
text-align: left;
background: none;
box-shadow: none;
min-height: 22px;
color: #444;
margin: 0 20px 10px;
}
.podarok .pick-item__label {
font-size: 18px;
top: 0;
left: 0;
margin-left: 0;
padding-left: 35px;
}
.podarok .pick-item__input:checked + .pick-item__label:after {
content: "check";
display: block;
width: 20px;
height: 20px;
background: #fbd232;
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
color: #fff;
font-family: 'Material Icons';
}
.podarok .pick-item__label:before {
content: "check";
display: block;
width: 20px;
height: 20px;
background: #fff;
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
opacity: 0.35;
font-family: 'Material Icons';
color: #000;
}
.pick-item.nap {
width: 13.5%;
margin: 0;
background: none;
min-height: 90px;
box-shadow: 0 0 1px #999;
border-radius: 0;
}
.pick-item.nap_img {
width: 13.5%;
line-height: 1;
margin: 0;
height: 90px;
min-height: 90px;
box-shadow: 0 0 1px #fff;
border-radius: 0;
}
.pick-item.nap_title {
width: 13.5%;
line-height: 3;
margin: 0;
height: 47px;
min-height: 47px;
box-shadow: 0 0 1px #fff;
border-radius: 0;
}
.pick-item.nap_img .pick-item__img {
height: 90px;
margin: 0;
}
.pick-item.nap_img .pick-item__img img {
height: 90px;
}
.last-step-form { width: 100%; padding-left: 15px; }
.last-step-form__label {
display: block;
font-size: 18px;
margin-bottom: 45px;
}
.last-step-form__input { display: block; width: 100%; max-width: 460px; padding: 11px 0 11px 50px; margin-bottom: 10px; border: 1px solid transparent; font-size: 22px; border-radius: 3px; background: #EFEFEF url("img/phone.png") no-repeat left 20px center; }
.last-step-form__button {
display: block;
width: 50%;
max-width: 50%;
padding: 25px 0;
border-radius: 2px;
border: 0;
background: #fbd232;
font-size: 18px;
margin-left: 25%;
color: #000;
text-transform: uppercase;
transition: .3s;
position: relative;
overflow: hidden;
margin-bottom: 10px;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 1px 5px 0 rgba(0,0,0,0.12),0 3px 1px -2px rgba(0,0,0,0.2);
}
.last-step-form__button span { font-weight: inherit; position: relative; z-index: 2; }
.last-step-form__button:hover { box-shadow: 0 6px 10px 0 rgba(0,0,0,0.14),0 1px 18px 0 rgba(0,0,0,0.12),0 3px 5px -1px rgba(0,0,0,0.3); }
.last-step-form__accept { font-size: 11px; color: #4A4A4A; }
.last-step-form__accept a { color: inherit; text-decoration: underline; }
.after-submit { background: #FFF; }
.after-submit .container { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-wrap: nowrap; flex-wrap: nowrap; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; -webkit-box-align: center; -ms-flex-align: center; align-items: center; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; width: 100%; height: 100%; padding: 150px 0; }
.after-submit__title { font-size: 22px; }
.after-submit__descr { font-size: 18px !important; padding: 10px 0 50px !important; font-weight: normal !important; }
.after-submit__descr a { color: #fbd232; text-decoration: underline; }
.test-modal-button { display: block; width: 100%; max-width: 330px; height: 66px; border-radius: 4px; overflow: hidden; border: 0; background: #09B677; font-size: 18px; font-weight: bold; position: relative; cursor: pointer; text-transform: uppercase; color: #FFF; -webkit-transition: .3s; transition: .3s; }
.test-modal-button:hover { background: #089E67; }
.test-modal-button span:after { content: ""; display: inline-block; width: 23px; height: 23px; background: url("img/form-w.svg") no-repeat center; margin: 0 0 -5px 10px; }
.digit {
height: 70px;width:452px;margin: 0 auto;
}
.digit_day {
width:452px;margin: 0 auto;
}
.digit_top {
color: #ff0000;display: block;margin: 20px 0 10px;text-transform: uppercase;font-weight: 300;
}
.digit_bottom {
color: #ff0000;display: block;margin: 30px 0 0;text-transform: uppercase;font-size: 25px;
}
.container {
width: 90%;
}
.form-input {
width: 44%;
height: auto;
background: white;
margin: 0 3%;
position: relative;
margin-bottom: 60px;
float: left;
}
.form-element-input {
outline: none;
height: 1.5rem;
display: block;
background: none;
padding: 0.125rem 0.125rem 0.0625rem;
font-size: 2rem;
border: 0;
line-height: 1.5;
width: 100%;
color: #333;
box-shadow: none;
opacity: 0.001;
transition: opacity 0.28s ease;
will-change: opacity;
}
.form-element-input::placeholder {
color: #a6a6a6;
transform: scale(0.9);
transform-origin: left top;
}
.form-element-bar {
height: 1px;
background: #999;
position: relative;
display: block;
}
.form-element-bar:after {
content: "";
position: absolute;
bottom: 0;
right: 0;
left: 0;
background: #fbd232;
height: 2px;
display: block;
transform: rotateY(90deg);
transition: transform .28s ease;
will-change: transform;
}
.form-element-label {
position: absolute;
top: 0rem;
line-height: 3.5rem;
pointer-events: none;
padding-left: 0.125rem;
z-index: 1;
font-size: 2rem;
margin: 0;
color: #a6a6a6;
transform: translateY(-50%);
transform-origin: left center;
transition: transform .28s ease, color .28s linear, opacity .28s linear;
will-change: transform, color, opacity;
cursor: text;
}
.form-element-hint {
color: #aaa;
}
.form-element-input.hasValue ~ .form-element-bar::after,
.form-element-input:focus ~ .form-element-bar::after {
transform: rotateY(0deg);
}
.form-element-input.hasValue ~ .form-element-label,
.form-element-input:focus ~ .form-element-label {
color: #fbd232;
}
.form-element-input.hasValue,
.form-element-input:focus {
opacity: 1;
}
.form-element-input.hasValue ~ .form-element-label,
.form-element-input:focus ~ .form-element-label {
transform: translateY(-100%) translateY(-0.5em) translateY(-2px);
cursor: pointer;
pointer-events: auto;
}
.form-is-success .form-element-input,
.form-is-success .form-element-label,
.form-is-success .form-element-hint {
color: #259337;
}
.form-has-error .form-element-label.form-element-label,
.form-has-error .form-element-hint {
color: #d9534f;
}
.form-has-error .form-element-bar:after {
background: #d9534f;
}
.form-has-error .form-element-input.hasValue ~ .form-element-label,
.form-has-error .form-element-input:focus ~ .form-element-label {
transform: translateY(-100%) translateY(-0.5em) translateY(-2px);
color: #d9534f
cursor: pointer;
pointer-events: auto;
}
.main-progress__extender:after {
content: "";
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-image: linear-gradient(-45deg,hsla(0,0%,100%,.5) 25%,transparent 0,transparent 50%,hsla(0,0%,100%,.5) 0,hsla(0,0%,100%,.5) 75%,transparent 0,transparent);
background-size: 10px 10px;
-webkit-animation: move 1.5s linear infinite;
animation: move 1.5s linear infinite;
overflow: hidden;
}
@-webkit-keyframes move{0%{background-position:0 0}to{background-position:20px 20px}}@keyframes move{0%{background-position:0 0}to{background-position:20px 20px}}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/bxslider/4.2.12/jquery.bxslider.min.js"></script>
<div class="col s12" style="padding: 15px 10px;">
<div class="z-depth-1">
<form class="portable-test-wrapper">
<!-- PROGRESS LINE START -->
<div class="progress-line">
<div class="main-progress">
<div class="main-progress__extender"></div>
<!-- STEPS TEXT START -->
<div class="main-progress__text">
<b>Осталось ответить на 4 вопроса,</b> чтобы получить гарантированный подарок
</div>
<!-- STEPS TEXT END -->
<!-- STEPS TEXT START -->
<div class="main-progress__text">
<b>Осталось ответить на 3 вопроса,</b> чтобы получить гарантированный подарок
</div>
<!-- STEPS TEXT END -->
<!-- STEPS TEXT START -->
<div class="main-progress__text">
<b>Осталось ответить на 2 вопроса,</b> чтобы получить гарантированный подарок
</div>
<!-- STEPS TEXT END -->
<!-- STEPS TEXT START -->
<div class="main-progress__text">
<b>Осталось ответить на 1 вопрос,</b> чтобы получить гарантированный подарок
</div>
<!-- STEPS TEXT END -->
<!-- STEPS TEXT START -->
<div class="main-progress__text" style="color: green;">
<b>Тест пройден.</b> Заполните форму ниже, чтобы зафиксировать свой подарок
</div>
<!-- STEPS TEXT END -->
</div>
<div class="container" style="width: 50%;float: left;">
<div class="step">
<div class="step__text">Шаг <span>1</span></div>
<div class="step__extender"></div>
</div>
</div>
<div class="main-progress__sales"><i>Ваша скидка:</i><span>0</span><br><b>0</b></div>
<div class="main-progress__sales"><i>Ваша скидка:</i><span>+2000</span><br><b>2000</b></div>
<div class="main-progress__sales"><i>Ваша скидка:</i><span>+2000</span><br><b>4000</b></div>
<div class="main-progress__sales"><i>Ваша скидка:</i><span>+2000</span><br><b>6000</b></div>
<div class="main-progress__sales"><i style="color: green;">Ваша скидка:</i><span>+3000</span><br><b>15000</b></div>
</div>
<!-- PROGRESS LINE END -->
<!-- STEPS START -->
<div class="container">
<div class="test-slider">
<!-- ONE-STEP START ////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<div class="step-slide">
<h3 class="step-slide__title">
Какой металл будете резать?
</h3>
<div class="step-slide__grid">
<!-- ONE-ITEM START -->
<label for="step0-1" class="pick-item met">
<input class="pick-item__input" type="radio" name="step0" id="step0-1" value="Листовой металл">
<div class="pick-item__label"></div><span>Листовой металл</span>
</label>
<!-- ONE-ITEM END -->
<!-- ONE-ITEM START -->
<label for="step0-2" class="pick-item met">
<input class="pick-item__input" type="radio" name="step0" id="step0-2" value="Круглая труба">
<div class="pick-item__label"></div><span>Круглая труба</span>
</label>
<!-- ONE-ITEM END -->
<div id="next0" class="btn-next-container" style="text-align: right;width: 100%;"></div>
</div>
</div>
<!-- ONE-STEP END -->
<!-- ONE-STEP START ////////////////////////////////////////////////////////////////////////////////////////////////////////////////-->
<div class="step-slide">
<h3 class="step-slide__title">
Какой толщины металл планируете резать?
</h3>
<div class="step-slide__grid">
<!-- ONE-ITEM START -->
<label for="step1-1" class="pick-item stil">
<input class="pick-item__input" type="radio" name="step1" id="step1-1" value="до 12 мм">
<div class="pick-item__label"></div><span>до 12 мм</span>
</label>
<!-- ONE-ITEM END -->
<!-- ONE-ITEM START -->
<label for="step1-2" class="pick-item stil">
<input class="pick-item__input" type="radio" name="step1" id="step1-2" value="12-20 мм">
<div class="pick-item__label"></div><span>12-20 мм</span>
</label>
<!-- ONE-ITEM END -->
<div id="prev1" class="btn-prev-container"></div>
<div id="next1" class="btn-next-container"></div>
</div>
</div>
<!-- ONE-STEP END -->
<!-- ONE-STEP START ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<div class="step-slide">
<h3 class="step-slide__title">
Какова длина обрабатываемого металла?
</h3>
<div class="step-slide__grid">
<!-- ONE-ITEM START -->
<label for="step2-1" class="pick-item fasad">
<input class="pick-item__input" type="radio" name="step2" id="step2-1" value="2500 мм">
<div class="pick-item__label"></div><span>2500 мм</span>
</label>
<!-- ONE-ITEM END -->
<!-- ONE-ITEM START -->
<label for="step2-2" class="pick-item fasad">
<input class="pick-item__input" type="radio" name="step2" id="step2-2" value="3000 мм">
<div class="pick-item__label"></div><span>3000 мм</span>
</label>
<!-- ONE-ITEM END -->
<div id="prev2" class="btn-prev-container"></div>
<div id="next2" class="btn-next-container"></div>
</div>
</div>
<!-- ONE-STEP END -->
<!-- ONE-STEP START /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -->
<div class="step-slide">
<h3 class="step-slide__title">
Какова ширина обрабатываемого металла?
</h3>
<div class="step-slide__grid">
<!-- ONE-ITEM START -->
<label for="step3-1" class="pick-item stol">
<input class="pick-item__input" type="radio" name="step3" id="step3-1" value="1250 мм">
<div class="pick-item__label"></div><span>1250 мм</span>
</label>
<!-- ONE-ITEM END -->
<!-- ONE-ITEM START -->
<label for="step3-2" class="pick-item stol">
<input class="pick-item__input" type="radio" name="step3" id="step3-2" value="1500 мм">
<div class="pick-item__label"></div><span>1500 мм</span>
</label>
<!-- ONE-ITEM END -->
<!-- ONE-ITEM START -->
<label for="step3-3" class="pick-item stol">
<input class="pick-item__input" type="radio" name="step3" id="step3-3" value="2000 мм">
<div class="pick-item__label"></div><span>2000 мм</span>
</label>
<!-- ONE-ITEM END -->
<div id="prev3" class="btn-prev-container"></div>
<div id="next3" class="btn-next-container"></div>
</div>
</div>
<!-- ONE-STEP END -->
<!-- ONE-STEP START -->
<div class="step-slide">
<h3 class="step-slide__title" style="font-size: 20px;">
Спасибо за ответы!<br>Оставьте свои контактные данные, чтобы получить результаты теста.
</h3>
<div class="step-slide__grid">
<h4 class="step-slide__discount">+ подарок</h4>
<div class="last-step-form">
<div class="last-step-form__label">Введите номер телефона и email, мы вам вышлем результаты:</div>
<button class="last-step-form__button btn-shine"><span>получить результат расчета</span></button>
</div>
</div>
</div>
<!-- ONE-STEP END -->
<!-- ONE-STEP START -->
<div class="step-slide">
<!-- AFTER SUBMIT START -->
<div class="after-submit">
<div class="container">
</div>
</div>
<!-- AFTER SUBMIT END -->
</div>
<!-- ONE-STEP END -->
</div>
</div>
<!-- STEPS END -->
</form>
</div>
</div>
Ответы (1 шт):
Автор решения: Евгений Кулик
→ Ссылка
Потому что у тебя в коде есть только логика, где ты прибавляешь значение к proggress.current
Как она у тебя будет уменьшаться, если ты нигде из неё не вычитаешь proggress.width?
Тебе надо при нажатие на кноку назад, делать что-то вроде
progress.current - progress.width;