jQuery(document).ready(function($){
// ouvrir la popup
$("#open-popup").click(function(){
$("#popup-section").fadeIn();
});
// fermer en cliquant à l’extérieur du contenu
$("#popup-section").click(function(e){
if($(e.target).is("#popup-section")){
$("#popup-section").fadeOut();
}
});
});
(function($){
$(document).ready(function(){
$('#open-popup').on('click', function(e){
e.preventDefault();
$('#popup-boxx').addClass('show-popup');
$('#popup-overlay').addClass('show-overlay');
});
$('#popup-overlay').on('click', function(){
$('#popup-boxx').removeClass('show-popup');
$('#popup-overlay').removeClass('show-overlay');
});
});
})(jQuery);
document.addEventListener("DOMContentLoaded", function () {
document.querySelectorAll(".switch-lang-ar").forEach(function(el) {
el.addEventListener("click", function (e) {
e.preventDefault(); // bloque le lien du bouton Divi
let url = new URL(window.location.href);
if (url.hostname.startsWith("www.")) {
url.hostname = url.hostname.replace("www.", "en.");
} else {
url.hostname = "en." + url.hostname;
}
window.location.href = url.toString();
});
});
});
(function($) {
function setup_collapsible_submenus() {
// mobile menu
$('.mobile_nav .menu-item-has-children > a').after('');
$('.mobile_nav .menu-item-has-children > a').each(function() {
$(this).next().next('.sub-menu').toggleClass('hide',1000);
});
$('.mobile_nav .menu-item-has-children > a + span').on('click', function(event) {
event.preventDefault();
$(this).toggleClass('menu-open');
$(this).next('.sub-menu').toggleClass('hide',1000);
});
}
$(window).load(function() {
setTimeout(function() {
setup_collapsible_submenus();
}, 700);
});
})(jQuery);