Last active
May 30, 2022 09:59
-
-
Save moderatorwes/03a8fd4152f43a981bc12178b9238137 to your computer and use it in GitHub Desktop.
Zendesk: Embed PDF
This file contains hidden or 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
<!--Add this to your article page using the Source editor --> | |
<iframe src="https://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe> |
This file contains hidden or 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
//responsive Iframes (add below $document.ready) | |
// Find all iframes | |
var $iframes = $( "iframe" ); | |
// Find & save the aspect ratio for all iframes | |
$iframes.each(function () { | |
$( this ).data( "ratio", this.height / this.width ) | |
// Remove the hardcoded width & height attributes | |
.removeAttr( "width" ) | |
.removeAttr( "height" ); | |
}); | |
// Resize the iframes when the window is resized | |
$( window ).resize( function () { | |
$iframes.each( function() { | |
// Get the parent container's width | |
var width = $( this ).parent().width(); | |
$( this ).width( width ) | |
.height( width * $( this ).data( "ratio" ) ); | |
}); | |
// Resize to fix all iframes on page load. | |
}).resize(); |
Wes, when I use this I now I get no preview available. do you have time to help me see whats going on?
@mtamosaitis - Since this code is pretty old I have no idea if it works anymore or not.
Do you have or know of anything that is more current?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wes, when I use this I now I get no preview available. do you have time to help me see whats going on?