custom-javascript.js 1.57 KB
// Add your custom JS here.
jQuery( document ).ready(function($) {
    $('.story-body-image').each(function(index) {  
        $(this).parents('.wp-block-column').attr("style", 'background-image:url('+$(this).children('img').attr('src')+');')
        $(this).children('img').hide();
        
    })
    $('.story-body-image-full').each(function(index) {  
        $(this).parents('.wp-block-columns').attr("style", 'background-image:url('+$(this).children('img').attr('src')+');')
        $(this).children('img').hide();
        
    });

    document.addEventListener( 'wpcf7mailsent', function( event ) {
        if ( '6' == event.detail.contactFormId ) { // Change 34 to the ID of the form 
                jQuery('#contest_popup').modal('show'); //this is the bootstrap modal popup id
            }
        if ( '108' == event.detail.contactFormId ) { // Change 34 to the ID of the form 
            jQuery('#contact_popup').modal('show'); //this is the bootstrap modal popup id
        }
            
       }, false );




$(window).resize(function(){
    var $sameHeightDivs = $('.link-block.image-text .text');
    var maxHeight = 0;
    $sameHeightDivs.each(function() {
        maxHeight = Math.max(maxHeight, $(this).outerHeight());
    });
    $sameHeightDivs.css({ height: maxHeight + 'px' });

});

$(document).ready(function () {    
    var $sameHeightDivs = $('.link-block.image-text .text');
    var maxHeight = 0;
    $sameHeightDivs.each(function() {
        maxHeight = Math.max(maxHeight, $(this).outerHeight());
    });
    $sameHeightDivs.css({ height: maxHeight + 'px' });
});
});