import './_featured-museum-posts.scss'
import $ from 'jquery'

const featuredMuseumPosts = function() {
    if ($('.featured-museum-posts').length) {
        $('.featured-museum-posts .news').on('mouseenter', function(e) {
            $(this).addClass('hover');
            $(this).find('a.cta').addClass('hover');
        }).on('mouseleave', function(e) {
            $(this).removeClass('hover');
            $(this).find('a.cta').removeClass('hover');
        });
    }
};

document.addEventListener('DOMContentLoaded', function() {
    featuredMuseumPosts()
}, false);

window.addEventListener('acf/loaded/featured-museum-posts', function(e) {
    featuredMuseumPosts()
});