$('body').on('submit', 'form', function() { ... });
- modal.classList.add('modal_show')
const modalContent = modal.querySelector('.modal__content')
if ( (modal.classList.contains('modal_show')) && (e.target != modalContent) ) {
modal.classList.remove('modal_show')
+ } else {
+ modal.classList.add('modal_show')
+ }
const steps = [ /* ... */ ];
let currentStep = 0;
const quizQuestion = document.querySelector('.quiz__question');
const quizAnswers = document.querySelector('.quiz__answers');
const prevBtn = document.querySelector('.quiz__button_prev');
const nextBtn = document.querySelector('.quiz__button_next');
prevBtn.addEventListener('click', () => nextStep(-1));
nextBtn.addEventListener('click', () => nextStep(+1));
function nextStep(stepChange) {
currentStep = Math.max(0, Math.min(steps.length - 1, currentStep + stepChange));
prevBtn.disabled = currentStep === 0;
nextBtn.disabled = currentStep === steps.length - 1;
quizQuestion.innerHTML = steps[currentStep].question;
quizAnswers.innerHTML = steps[currentStep].answers.map(n => `<li>${n}</li>`).join('');
}
nextStep(0);
<button class="modal-heading__button modal-heading__button-login" v-if="view==='log'" @click="view='reg'">login</button>
<button class="modal-heading__button modal-heading__button-register" v-else-if="view==='reg'" @click="view='3rd'">register</button>
<button class="modal-heading__button modal-heading__button-thirdOption" v-else-if="view==='3rd'" @click="view='log'">the wae of the deval</button>
...
data(){
return {
view: 'log'
}
}
...
вот песочница, если чо<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100">
<defs>
<filter id="shadow">
<feDropShadow dx="0" dy="4" stdDeviation="2" flood-color="grey" />
</filter>
</defs>
<polygon points="30.1,84.5 10.2,50 30.1,15.5 69.9,15.5 89.8,50 69.9,84.5"
filter="url(#shadow)" fill="hsl(156,80%,50%)"></polygon>
</svg>
buy.on('click', function() {
// При нажатии на кнопку складываются значения
let productPrice = +buy.attr('data-price');
let productCount = +$('#input').val();
let oldSum = +cartPrice.text();
let oldCount = +cartCount.text();
cartPrice.text(oldSum+productPrice*productCount);
cartCount.text(oldCount+productCount);
})