var t = $("#view .iframeContainer").data('type');
$("#view").find('.iframeHolder,.content,.mview').attr('data-type', t);
-
+
$("#view .iframeContainer iframe").on('load', function () {
try {
- var cw = $(this).get(0).contentWindow;
- cw.document.style.maxWidth = '100%';
- cw.document.style.overflow = 'auto';
- }catch (e) {
-
+ var doc = getIframeDocument(this);
+ doc.body.style.maxWidth = '100%';
+ doc.body.style.overflow = 'auto';
+ } catch (e) {
}
$this.resize();
});
var iframe = $("#view .iframeHolder iframe");
iframe.css('width', w);
+ try {
+ var doc = getIframeDocument(iframe);
+ doc.body.style.maxWidth = w + 'px';
+ } catch (e) {
+ }
if (!fullscreen) {
var ih = -1;
try {
return b.indexOf(i) < 0;
});
}
+
+function getIframeDocument(iframe){
+ iframe = $(iframe).get(0);
+ var doc = iframe.contentWindow || iframe.contentDocument;
+ if (doc.document) {
+ doc = doc.document;
+ }
+ return doc;
+}
\ No newline at end of file