penscratch-2.js 483 B

123456789101112131415161718
  1. /*
  2. * Triggers resize event to make sure video widgets in the footer maintain the correct aspect ratio
  3. */
  4. ( function( $ ) {
  5. $( window ).on( 'load', function() {
  6. setTimeout( function(){
  7. if ( typeof( Event ) === 'function' ) {
  8. window.dispatchEvent( new Event( 'resize' ) );
  9. } else {
  10. var event = window.document.createEvent( 'UIEvents' );
  11. event.initUIEvent( 'resize', true, false, window, 0 );
  12. window.dispatchEvent( event );
  13. }
  14. } );
  15. } );
  16. } )( jQuery );