<script>
function openhide(){
$('.hide_sett_passive').addClass('hide_sett_active');
$('.hide_sett_passive').removeClass('hide_sett_passive');
};
function closehide(){
$('.hide_sett_active').addClass('hide_sett_passive');
$('.hide_sett_active').removeClass('hide_sett_active');
};
function openprebook(){
$('.preblock_passive').addClass('preblock_active');
$('.preblock_passive').removeClass('preblock_passive');
};
function closeprebook(){
$('.preblock_active').addClass('preblock_passive');
$('.preblock_active').removeClass('preblock_active');
};
function open_prebooksItems1(){
$('.preblock_hs_itm1_passive').addClass('preblock_hs_itm1_active');
$('.preblock_hs_itm1_passive').removeClass('preblock_hs_itm1_passive');
};
function close_prebooksItems1(){
$('.preblock_hs_itm1_active').addClass('preblock_hs_itm1_passive');
$('.preblock_hs_itm1_active').removeClass('preblock_hs_itm1_active');
};
function close_when_all_close(){
$('.cl').click(function(){
closehide();
closeprebook();
close_prebooksItems1();
});
};
function MakeActive_hide_sett_passive(){
$('.shesterenki').click(function(){openhide();});};
function click_hs_itm1(){
$('.hs_itm1').click(function(){
openprebook();
open_prebooksItems1();
});
};
$(document).ready(function(){
close_when_all_close();
MakeActive_hide_sett_passive();
click_hs_itm1();
});
</script>
Интересно мнение о моем коде
Сори за говнокод
function openhide(){
document.querySelector('.hide_sett_passive').classList.add('hide_sett_active');
document.querySelector('.hide_sett_passive').classList.remove('hide_sett_passive');
}
function closehide(){
document.querySelector('.hide_sett_active').classList.add('hide_sett_passive');
document.querySelector('.hide_sett_active').classList.remove('hide_sett_active');
}
function openprebook(){
document.querySelector('.preblock_passive').classList.add('preblock_active');
document.querySelector('.preblock_passive').classList.remove('preblock_passive');
}
function closeprebook(){
document.querySelector('.preblock_active').classList.add('preblock_passive');
document.querySelector('.preblock_active').classList.remove('preblock_active');
}
function open_prebooksItems1(){
document.querySelector('.preblock_hs_itm1_passive').classList.add('preblock_hs_itm1_active');
document.querySelector('.preblock_hs_itm1_passive').classList.remove('preblock_hs_itm1_passive');
}
function close_prebooksItems1(){
document.querySelector('.preblock_hs_itm1_active').classList.add('preblock_hs_itm1_passive');
document.querySelector('.preblock_hs_itm1_active').classList.remove('preblock_hs_itm1_active');
}
function close_when_all_close(){
document.querySelector('.cl').addEventListener("click", function() {
closehide();
closeprebook();
close_prebooksItems1();
})
}
function MakeActive_hide_sett_passive(){
document.querySelector('.shesterenki').addEventListener("click", function() {
openhide();
});
}
function click_hs_itm1(){
document.querySelector('.hs_itm1').addEventListener("click", function() {
openprebook();
open_prebooksItems1();
});
}
document.addEventListener("DOMContentLoaded", function() {
close_when_all_close();
MakeActive_hide_sett_passive();
click_hs_itm1();
});