$('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 iStep = 0;
const question = document.querySelector('.quiz__question');
const answers = document.querySelector('.quiz__answers');
const prev = document.querySelector('.quiz__button_prev');
const next = document.querySelector('.quiz__button_next');
prev.addEventListener('click', () => nextStep(-1));
next.addEventListener('click', () => nextStep(+1));
function nextStep(stepChange) {
iStep = Math.max(0, Math.min(steps.length - 1, iStep + stepChange));
prev.disabled = iStep === 0;
next.disabled = iStep === steps.length - 1;
question.innerHTML = steps[iStep].question;
answers.innerHTML = steps[iStep].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);
})