<form>
тоже name задал бы я, затестить. const all = {
"global": [
{
"id": "1",
"width": "50",
"height": "150"
},
{
"id": "2",
"width": "150",
"height": "350"
},
{
"id": "3",
"width": "750",
"height": "850"
}
]
};
for(item of all.global){
let elm = document.querySelector('.layer' + item.id);
elm.style.width = item.width + 'px';
elm.style.height = item.height + 'px';
}
.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');
});
// я не сумасшедший.
p.blue{
color: red
}
p{
color: orange
}
.blue{
color: green
}
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');
});