jQuery.fn.jQueryEqualHeight=function(innerDiv){
if(innerDiv==undefined){
innerDiv='.card';
}
var currentTallest=0, currentRowStart=0, rowDivs=new Array(), topPosition=0;
jQuery(this).each(function(){
jQuery(this).find(innerDiv).height('auto')
topPosition=jQuery(this).position().top;
if(currentRowStart!=topPosition){
for (currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].find(innerDiv).height(currentTallest);
}
rowDivs.length=0;
currentRowStart=topPosition;
currentTallest=jQuery(this).find(innerDiv).height();
rowDivs.push(jQuery(this));
}else{
rowDivs.push(jQuery(this));
currentTallest=(currentTallest < jQuery(this).find(innerDiv).height()) ? (jQuery(this).find(innerDiv).height()):(currentTallest);
}
for (currentDiv=0 ; currentDiv < rowDivs.length ; currentDiv++){
rowDivs[currentDiv].find(innerDiv).height(currentTallest);
}});
};
var x, i, j, l, ll, selElmnt, a, b, c;
x=document.getElementsByClassName("custom-select");
l=x.length;
for (i=0; i < l; i++){
selElmnt=x[i].getElementsByTagName("select")[0];
ll=selElmnt.length;
a=document.createElement("DIV");
a.setAttribute("class", "select-selected");
a.innerHTML=selElmnt.options[selElmnt.selectedIndex].innerHTML;
x[i].appendChild(a);
b=document.createElement("DIV");
b.setAttribute("class", "select-items select-hide");
for (j=1; j < ll; j++){
c=document.createElement("DIV");
c.innerHTML=selElmnt.options[j].innerHTML;
c.addEventListener("click", function(e){
var y, i, k, s, h, sl, yl;
s=this.parentNode.parentNode.getElementsByTagName("select")[0];
sl=s.length;
h=this.parentNode.previousSibling;
for (i=0; i < sl; i++){
if(s.options[i].innerHTML==this.innerHTML){
s.selectedIndex=i;
h.innerHTML=this.innerHTML;
y=this.parentNode.getElementsByClassName("same-as-selected");
yl=y.length;
for (k=0; k < yl; k++){
y[k].removeAttribute("class");
}
this.setAttribute("class", "same-as-selected");
break;
}}
h.click();
});
b.appendChild(c);
}
x[i].appendChild(b);
a.addEventListener("click", function(e){
e.stopPropagation();
closeAllSelect(this);
this.nextSibling.classList.toggle("select-hide");
this.classList.toggle("select-arrow-active");
});
}
function closeAllSelect(elmnt){
var x, y, i, xl, yl, arrNo=[];
x=document.getElementsByClassName("select-items");
y=document.getElementsByClassName("select-selected");
xl=x.length;
yl=y.length;
for (i=0; i < yl; i++){
if(elmnt==y[i]){
arrNo.push(i)
}else{
y[i].classList.remove("select-arrow-active");
}}
for (i=0; i < xl; i++){
if(arrNo.indexOf(i)){
x[i].classList.add("select-hide");
}}
}
document.addEventListener("click", closeAllSelect);
if(jQuery(window).width() > 768){
jQuery(window).resize(function(){location.reload();})
};
jQuery(document).ready(function($){
$(window).on('load',function(){
var containerPos=$(".container").offset();
$('.container-left').css('width','calc(100% - '+ containerPos.left +'px)');
})
$('.filter-arg').on("click", function (e){
e.preventDefault();
var targetArg=$(this).attr('data-arg');
var targetvalue=$(this).attr('data-value');
var url=new URL(document.location);
url.searchParams.set(targetArg, targetvalue);
document.location=url;
});
$('.countries-slider').slick({
slidesToShow: 4,
slidesToScroll: 1,
dots: false,
arrows: true,
responsive: [
{
breakpoint: 991,
settings: {
slidesToShow: 1,
}},
{
breakpoint: 767,
settings: {
slidesToShow: 1,
dots: true,
arrows: false,
}}
]
});
$('.visvakanties-slider').slick({
slidesToShow: 2,
slidesToScroll: 1,
dots: false,
arrows: true,
responsive: [
{
breakpoint: 991,
settings: {
slidesToShow: 1,
}},
{
breakpoint: 767,
settings: {
slidesToShow: 1,
dots: true,
arrows: false,
}}
]
});
$('.review-slider').slick({
slidesToScroll: 1,
dots: false,
arrows: true,
slidesToShow: 1,
centerMode: true,
variableWidth: true,
responsive: [
{
breakpoint: 767,
settings: {
centerMode: false,
variableWidth: false,
dots: true,
arrows: false,
}}
]
});
$('.uht-slider').slick({
slidesToShow: 2,
slidesToScroll: 1,
dots: true,
arrows: false,
responsive: [
{
breakpoint: 1199,
settings: {
slidesToShow: 1,
}}
]
});
$('.reviews-list .button').click(function(){
$('.reviews-list .review-wrap').show();
$(this).hide();
})
$('.filter-btn').click(function(){
$('body').addClass('fixed');
var scroll=$(window).scrollTop();
var hh=$('.site-header').outerHeight();
var h;
if(scroll <=hh){
h=$(window).height() - $('.site-header').outerHeight()- scroll;
}else{
h=$(window).height();
}
$('.filter-popup').css('height', h).show();
})
$('.btn-cancel').click(function(){
$('.filter-popup').hide();
$('body').css('overflow','initial');
$("#map_panel").slideToggle();
})
$('.search-fld').click(function(){
if($(this).hasClass('active')){
$(this).next().hide();
$(this).removeClass('active');
}else{
$(this).next().show();
$(this).addClass('active');
}})
$('.property-type-options input').on('change', function (){
$(this).closest('.property-type-options').slideUp().prev().removeClass('active').find('.search-val').text($(this).next().text());
})
$('ul.tabs li').click(function(){
var tab_id=$(this).attr('data-tab');
$('ul.tabs li').removeClass('current');
$('.tab-content').removeClass('current');
$(this).addClass('current');
$("#"+tab_id).addClass('current');
})
$('.share-toggle').click(function(){
$(this).next().slideToggle();
})
$('.show-more').click(function(){
var clicked=$(this);
if(clicked.hasClass('active')){
clicked.removeClass('active').siblings('.showing').slideUp(function(){
});
clicked.siblings('.show').removeClass('active');
clicked.find('span').text(clicked.find('span').attr('data-more'));
}else{
clicked.addClass('active').siblings('.showing').slideDown(function(){
clicked.siblings('.show').addClass('active');
});
clicked.find('span').text(clicked.find('span').attr('data-less'));
}});
paragraphCount=$(".about-vacation .description > p").size();
$("#hider").hide();
$("#shower").hide();
if(paragraphCount > 1){
$("#shower").show();
}
$("#hider,#hider1").click(function(){
$(".about-vacation .description p").not(":first").slideToggle();
$("#hider").hide();
$("#shower").show();
});
$("#shower").click(function(){
$(".about-vacation .description p").not(":first").slideToggle();
$("#shower").hide();
$("#hider").show();
});
$(".about-vacation .description p").not(":first").slideToggle();
paragraphCount=$(".about-vacation .description2 > p").size();
$("#hider1").hide();
$("#shower1").hide();
if(paragraphCount > 1){
$("#shower1").show();
}
$("#hider1").click(function(){
$(".about-vacation .description2 p").not(":first").slideToggle();
$("#hider1").hide();
$("#shower1").show();
});
$("#shower1").click(function(){
$(".about-vacation .description2 p").not(":first").slideToggle();
$("#shower1").hide();
$("#hider1").show();
});
$(".about-vacation .description2 p").not(":first").slideToggle();
$('.lang-toggle').click(function(e){
e.preventDefault();
$(this).next().slideToggle();
});
$(".language-menu li a").click(function (){
var imgSource=$(this).html();
$(this).parents('.menu-lang').find('.lang-toggle').html(imgSource);
$(this).closest().slideUp();
});
$('.header-menu > .menu-item:has(ul)').append('<span class="arrow icon-dropdown"></span>');
jQuery('.toggle-mnu').click(function(){
$("html").toggleClass("overflow-hidden");
$(this).toggleClass('on').closest('.site-header').toggleClass('active');
$('.header-nav').toggleClass('show');
if($('.site-header').hasClass('abs-header')){
$('.site-header').toggleClass('light-header');
}});
$('.about-gallery .ul').slick({
slidesToScroll: 1,
dots: true,
arrows: false,
slidesToShow: 3,
responsive: [
{
breakpoint: 767,
settings: {
slidesToShow: 1
}},
]
});
if($(window).width() < 768){
$('.vacations-destinations .col3 h5').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active').parent().next().slideUp();
}else{
$(this).closest('.row').siblings().find('.col9').slideUp();
$(this).closest('.row').siblings().find('h5').removeClass('active');
$(this).addClass('active').parent().next().slideDown();
}})
}
$(window).on('load resize',function(){
if($(window).width() < 768 &&
!$('body').hasClass('archive')
){
/*
$('.vacations-destinations .col3 h5').click(function(){
if($(this).hasClass('active')){
$(this).removeClass('active').parent().next().slideUp();
}else{
$(this).closest('.row').siblings().find('.col9').slideUp();
$(this).closest('.row').siblings().find('h5').removeClass('active');
$(this).addClass('active').parent().next().slideDown();
}})
*/
$('.related-posts .related-ul').slick({
slidesToScroll: 1,
dots: true,
arrows: false,
slidesToShow: 1,
});
$('.related-team .row').slick({
slidesToScroll: 1,
dots: true,
arrows: false,
slidesToShow: 1,
});
}
if($(window).width() < 1200){
$(document).on('click','.header-menu > li.menu-item span.arrow',function(){
console.log('clicked');
var tt=$(this).toggleClass('on').siblings('a').text();
$(this).prev().slideToggle();
if($(this).prev().has('.back-menu').length < 1){
$(this).prev().prepend('<li class="back-menu"><a href="#">'+ tt +'</a></li>');
}});
$('.sub-menu').on('click','.back-menu a',function(){
$(this).closest('.sub-menu').slideUp();
})
}
if($(window).width() > 1199){
$(document).on('click','.header-menu > li.menu-item.menu-item-has-children > a',function(e){
console.log('clicked');
e.preventDefault();
if($(this).hasClass('active')){
$(this).toggleClass('active');
$('body').removeClass('open-menu');
if($('.site-header').hasClass('abs-header')){
$('.site-header').addClass('light-header');
}}else{
$(this).addClass('active');
$(this).parent().siblings().find('a').removeClass('active');
$(this).parent().siblings().find('.sub-menu').hide();
$('body').addClass('open-menu');
if($('.site-header').hasClass('abs-header')){
$('.site-header').removeClass('light-header');
}}
});
$('.header-menu > li.menu-item.menu-item-has-children').hover(function (){
if($('.site-header').hasClass('abs-header')){
$('.site-header').removeClass('light-header');
}}, function(){
if($('.site-header').hasClass('abs-header')){
$('.site-header').addClass('light-header');
}});
}
if($(window).width() < 1199){
$(".header-menu > li.menu-item.menu-item-has-children > a").on("click", function (){
$("#sub-menu").addClass("moves-out");
$("div" + $(this).attr("href")).addClass("moves-out");
});
$("#sub-menu .back-btn").on("click", function (){
$("#sub-menu").removeClass("moves-out");
$("#sub-menu .category-section").removeClass("moves-out");
});
$(" #sub-menu .c-close-btn").on("click", function (){
$("#sub-menu").removeClass("moves-out");
$("#sub-menu .category-section").removeClass("moves-out");
$("html").removeClass("overflow-hidden");
$('.site-header').removeClass('active');
$('.toggle-mnu').removeClass('on');
$('.header-nav').removeClass('show');
});
/*
$(document).on('click','.header-menu > li.menu-item.menu-item-has-children > a',function(e){
console.log('clicked');
e.preventDefault();
if($(this).hasClass('active')){
$(this).toggleClass('active').next().css({display: "none"});
$('body').removeClass('open-menu');
if($('.site-header').hasClass('abs-header')){
$('.site-header').addClass('light-header');
}}else{
$(this).addClass('active').next().css({display: "block"});
$(this).parent().siblings().find('a').removeClass('active');
$(this).parent().siblings().find('.sub-menu').hide();
$('body').addClass('open-menu');
if($('.site-header').hasClass('abs-header')){
$('.site-header').removeClass('light-header');
}}
});
*/
}
if($(window).width()>840){
$('.main-posts .blog-post').jQueryEqualHeight('figure');
$('.contact-sections').jQueryEqualHeight('.cbox p');
}})
});
const btns=document.querySelectorAll(".acc-btn");
function accordion(){
this.classList.toggle("is-open");
const content=this.nextElementSibling;
if(content.style.maxHeight) content.style.maxHeight=null;
else content.style.maxHeight=content.scrollHeight + "px";
}
btns.forEach((el)=> el.addEventListener("click", accordion));
window.aeBindInfoTooltips=function (root){
const scope=root||document;
const items=scope.querySelectorAll('.info-item[data-tooltip]:not([data-ae-tooltip-bound])');
if(!items.length) return;
items.forEach((el)=> {
el.setAttribute('data-ae-tooltip-bound', '1');
if(!el.title&&el.dataset.tooltip){
el.title=el.dataset.tooltip;
}
el.addEventListener('click', (e)=> {
e.stopPropagation();
document.querySelectorAll('.info-item.tooltip-active').forEach((other)=> {
if(other!==el) other.classList.remove('tooltip-active');
});
el.classList.toggle('tooltip-active');
});
});
};
(function (){
window.aeBindInfoTooltips(document);
document.addEventListener('click', ()=> {
document.querySelectorAll('.info-item.tooltip-active').forEach((el)=> {
el.classList.remove('tooltip-active');
});
});
})();
(function (){
const btn=document.querySelector('.ae-load-more');
if(!btn) return;
const pagination=document.querySelector('.main .pagination');
if(pagination) pagination.style.display='none';
const grid=document.querySelector('.related-vacation .row');
if(!grid) return;
const cfg=window.aeLoadMore||{};
if(!cfg.ajaxurl||!cfg.nonce) return;
let io=null;
let inFlight=false;
async function loadNext(){
if(inFlight||btn.disabled||!document.body.contains(btn)) return;
inFlight=true;
btn.disabled=true;
btn.classList.add('is-loading');
const originalText=btn.textContent;
btn.textContent=btn.dataset.loadingText||'Laden…';
const fd=new FormData();
fd.append('action', 'ae_load_more_venues');
fd.append('nonce', cfg.nonce);
fd.append('paged', btn.dataset.paged||'1');
fd.append('term_id', btn.dataset.termId||'0');
fd.append('taxonomy', btn.dataset.taxonomy||'category');
try {
const res=await fetch(cfg.ajaxurl, { method: 'POST', body: fd, credentials: 'same-origin' });
const json=await res.json();
if(!json||!json.success) throw new Error('bad response');
const tmp=document.createElement('div');
tmp.innerHTML=json.data.html;
const frag=document.createDocumentFragment();
while (tmp.firstChild) frag.appendChild(tmp.firstChild);
grid.appendChild(frag);
if(typeof window.aeBindInfoTooltips==='function'){
window.aeBindInfoTooltips(grid);
}
btn.dataset.paged=String(json.data.next_paged);
if(!json.data.has_more){
if(io) io.disconnect();
btn.parentNode.removeChild(btn);
}else{
btn.disabled=false;
btn.classList.remove('is-loading');
btn.textContent=originalText;
if(io){
io.unobserve(btn);
requestAnimationFrame(()=> {
if(document.body.contains(btn)) io.observe(btn);
});
}}
} catch (err){
btn.disabled=false;
btn.classList.remove('is-loading');
btn.textContent=originalText;
} finally {
inFlight=false;
}}
btn.addEventListener('click', loadNext);
if('IntersectionObserver' in window){
io=new IntersectionObserver((entries)=> {
for (const entry of entries){
if(entry.isIntersecting) loadNext();
}}, { rootMargin: '400px 0px' });
io.observe(btn);
}})();
document.addEventListener('DOMContentLoaded', ()=> {
if(window.innerWidth > 767) return;
const container=document.querySelector('.ae-vacation-grid');
if(!container) return;
const countryBlocks=container.querySelectorAll('.ae-vacation-country-block');
requestAnimationFrame(()=> {
const containerTop=container.offsetTop;
for (const block of countryBlocks){
const header=block.querySelector('.ae-vacation-country-name');
if(header&&header.textContent.trim().toLowerCase().startsWith('nederland')){
container.scrollTop=header.offsetTop - containerTop;
break;
}}
});
const items=container.querySelectorAll('.ae-vacation-item');
let currentActive=null;
const observer=new IntersectionObserver(entries=> {
entries.forEach(entry=> {
if(entry.isIntersecting){
if(currentActive) currentActive.classList.remove('is-active');
entry.target.classList.add('is-active');
currentActive=entry.target;
}});
}, {
root: container,
threshold: 0.65
});
items.forEach(item=> observer.observe(item));
const originalHTML=container.innerHTML;
let scrollPending=false;
container.addEventListener('scroll', ()=> {
if(scrollPending) return;
scrollPending=true;
requestAnimationFrame(()=> {
scrollPending=false;
const scrollTop=container.scrollTop;
const clientHeight=container.clientHeight;
const scrollHeight=container.scrollHeight;
if(scrollTop + clientHeight >=scrollHeight - 10){
container.insertAdjacentHTML('beforeend', originalHTML);
}else if(scrollTop <=5){
container.insertAdjacentHTML('afterbegin', originalHTML);
container.scrollTop +=1;
}});
}, { passive: true });
});
(function (){
var WIDGET_URL='https://ticket.anglingescapes.nl/modules/chat/js/widget.js?v=3941';
var ANCHOR_ID='ae-freescout-anchor';
var loadingState=null;
function setupFreeScoutConfig(){
var lang=(document.documentElement.lang||'en').toLowerCase().split('-')[0];
if(['nl', 'de', 'en', 'es', 'fr', 'it'].indexOf(lang)===-1){
lang='en';
}
window.FreeScoutW={
s: {
color: '#ff7900',
position: 'br',
locale: lang,
require: [],
id: 1271802239
}};}
function getOrCreateAnchor(){
var anchor=document.getElementById(ANCHOR_ID);
if(!anchor){
anchor=document.createElement('span');
anchor.id=ANCHOR_ID;
anchor.style.cssText=[
'position:fixed',
'bottom:20px',
'right:20px',
'width:1px',
'height:1px',
'opacity:0',
'pointer-events:none',
'z-index:-1'
].join(';');
document.body.appendChild(anchor);
}
return anchor;
}
function tryOpenChat(){
if(!window.FreeScoutW||typeof window.FreeScoutW.show!=='function'){
return false;
}
var anchor=getOrCreateAnchor();
try {
window.FreeScoutW.show(anchor, false);
rebrandPoweredBy();
return true;
} catch (e){
console.warn('[FreeScout] show() faalde:', e);
return false;
}}
var rebrandDone=false;
function rebrandPoweredBy(){
function patchOnce(){
var links=document.querySelectorAll('a[href*="freescout"], a[href*="FreeScout"]');
var changed=0;
links.forEach(function (link){
if(link.id===ANCHOR_ID) return;
link.href='https://www.altenasolutions.com';
link.textContent='altenasolutions.com';
link.title='altenasolutions.com';
link.target='_blank';
link.rel='noopener';
changed++;
});
document.querySelectorAll('*').forEach(function (el){
if(el.children.length===0&&/freescout/i.test(el.textContent) &&
!/altenasolutions/i.test(el.textContent)){
el.textContent=el.textContent.replace(/freescout/gi, 'altenasolutions.com');
changed++;
}});
return changed;
}
var attempts=0;
var poll=setInterval(function (){
attempts++;
if(patchOnce() > 0||attempts >=20){
clearInterval(poll);
}}, 250);
if(rebrandDone) return;
rebrandDone=true;
var observer=new MutationObserver(function (){
patchOnce();
});
observer.observe(document.body, { childList: true, subtree: true });
}
function loadWidget(callback){
if(loadingState===true){
if(callback) callback();
return;
}
if(Array.isArray(loadingState)){
loadingState.push(callback);
return;
}
loadingState=[callback];
setupFreeScoutConfig();
var script=document.createElement('script');
script.async=true;
script.id='freescout-w';
script.src=WIDGET_URL;
script.onload=function (){
var attempts=0;
var maxAttempts=100;
var poll=setInterval(function (){
attempts++;
if(window.FreeScoutW&&typeof window.FreeScoutW.show==='function'){
clearInterval(poll);
var queued=loadingState;
loadingState=true;
queued.forEach(function (cb){ if(cb) cb(); });
}else if(attempts >=maxAttempts){
clearInterval(poll);
console.warn('[FreeScout] FreeScoutW.show niet beschikbaar na 5s', window.FreeScoutW);
}}, 50);
};
script.onerror=function (){
console.error('[FreeScout] widget.js kon niet worden geladen');
loadingState=null;
};
document.head.appendChild(script);
}
window.aeOpenChat=function (){
loadWidget(function (){
if(!tryOpenChat()){
console.warn('[FreeScout] kon chat-paneel niet openen', window.FreeScoutW);
}});
};})();