$.ajax({
method: "POST",
contentType: false,
processData: false,
data: new FormData($(".divAddObject:visible form")[0]),
url: "handlers/add_object.php",
success: function (data){}
});
var formData = $(this).closest('form').serialize();
$.ajax({
method: "POST",
contentType: false,
processData: false,
data: formData,
url: "handlers/add_object.php",
success: function (data){}
});
.parent .block:nth-child(2) ~ .block{
display: none
}
.parent.active .block:nth-child(2) ~ .block{
display: block
}
// jQuery
$('.button').on('click', function(){
$('.parent').addClass('active');
});
// или не jQuery
document.querySelector('.button').addEventListener('click', function(){
document.querySelector('.parent').classList.add('active');
});
// я не сумасшедший.
var sumContainer = document.querySelector('#summ');
sumContainer.setAttribute('data-original-price', sumContainer.textContent); // Сохраняем оригинальную цену в аттрибут
document.querySelector('#kup').addEventListener('input', function(){
if(this.value.toLowerCase() == 'kupon'){
sumContainer.textContent = sumContainer.textContent * 1 - 150
} else {
sumContainer.textContent = sumContainer.getAttribute('data-original-price')
}
})
window.onload = function(){
document.querySelector('.youtube_block button').addEventListener('click', () => {
document.querySelector('.youtube_block').classList.add('hide_youtube_block')
})
}
<style>
.projects__cards{
display: -webkit-flex;
display: -moz-flex;
display: -ms-flex;
display: -o-flex;
display: flex;
justify-content: flex-start;
align-items: flex-start;
flex-wrap: wrap;
flex-direction: column-reverse;
}
.projects__card-7:hover + svg path{
display: block !important;
}
</style>
<div class="col-12 projects__cards">
<div class="projects__card text-center projects__card-7">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aperiam amet sapiente distinctio, temporibus tenetur sint, blanditiis non ipsam minima maiores, ipsum illum molestias, deleniti rerum qui! Autem, sed quasi culpa.</div>
<svg class="projects-paths" width="740" height="405" viewBox="0 0 740 405" fill="red" xmlns="http://www.w3.org/2000/svg">
<path style="display: none;" d="M 213.1,6.7c -32.4-14.4-73.7,0-88.1,30.6C 110.6,4.9,67.5-9.5,36.9,6.7C 2.8,22.9-13.4,62.4,13.5,110.9C 33.3,145.1,67.5,170.3,125,217c 59.3-46.7,93.5-71.9,111.5-106.1C 263.4,64.2,247.2,22.9,213.1,6.7z" /></svg>
</div>
$('.mobile__children-item').on('click', function() {
$(this).toggleClass('arrow__rotate');
$('.item__submenu', this).stop().slideToggle('300');
});