| Server IP : 213.186.33.4 / Your IP : 216.73.216.146 Web Server : Apache System : Linux webm005.cluster103.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64 User : karinebmkh ( 644538) PHP Version : 8.4.22 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/karinebmkh/www2/wp-content/plugins/so-widgets-bundle/widgets/image-grid/js/ |
Upload File : |
/* globals jQuery, sowb */
var sowb = window.sowb || {};
jQuery( function ( $ ) {
sowb.setupImageGrids = function () {
$( '.sow-image-grid-wrapper' ).each( function () {
var $$ = $( this );
$$.imagesLoaded( function () {
var maxWidth = $$.data( 'max-width' ),
maxHeight = $$.data( 'max-height' );
if ( maxWidth !== undefined || maxHeight !== undefined ) {
$$.find( 'img' ).each( function () {
var $img = $( this ).css( 'display', 'block' ),
ratio = $img.width() / $img.height();
var width = [];
// Lets set the widths of the image
if ( maxWidth !== undefined && $img.width() > maxWidth ) {
width.push( maxWidth );
}
if ( maxHeight !== undefined && $img.height() > maxHeight ) {
width.push( Math.round( maxHeight * ratio ) );
}
if ( width.length ) {
width = Math.min.apply( Math, width );
$img.css( 'max-width', width );
}
} );
}
else {
$$.find( 'img' ).css( 'display', 'block' );
}
var alignImages = function () {
};
alignImages();
$( window ).resize( alignImages );
} );
} );
};
sowb.setupImageGrids();
$( sowb ).on( 'setup_widgets', sowb.setupImageGrids );
} );
window.sowb = sowb;