Created
March 27, 2019 20:42
-
-
Save cnasal/035d246aad430d9cfb91ada696f1a2ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Fix PDFs loaded in tabs --> | |
<script type="text/javascript"> | |
jQuery(function() { | |
jQuery('.tab-link').click(function() { | |
setTimeout(function(){ | |
if (typeof(Event) === 'function') { | |
// modern browsers | |
window.dispatchEvent(new Event('resize')); | |
} else { | |
// for IE and other old browsers | |
// causes deprecation warning on modern browsers | |
var evt = window.document.createEvent('UIEvents'); | |
evt.initUIEvent('resize', true, false, window, 0); | |
window.dispatchEvent(evt); | |
} | |
} | |
, 100); | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment