custom-javascript.js
1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// 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' });
});
});