0
这适用于Firefox,但在Chrome上,我得到“Uncaught TypeError:无法读取属性'css'的空”错误on“onDialogOpen(){this.iframe.css({ ”模式窗口内的iFrame在Chrome上不工作
function show(options) {
// create our temporary iframe
this.iframe = $('<iframe name="' + (this.id = 'emh_' + +new Date) + '">')
.load($.proxy(onIframeLoad, this));
// show our dialog
this.iframe.dialog($.extend(true, {
title: 'Entity Viewer',
modal: true,
draggable: false,
resizable: false,
width: 800,
height: 500,
buttons: {
'Save & Continue': $.proxy(submitIframeForm, this)
},
open: $.proxy(onDialogOpen, this),
close: $.proxy(onDialogClose, this)
}, options));
alert(options.path);
// since our dialog is showing now, let's update the src of the iframe
this.iframe.attr('src', options.path + '?modal=true&unique=' + this.id);
}
function onDialogOpen() {
this.iframe
.css({
width: '100%',
padding: 0,
border: 0,
margin: 0
});
}
SilentTremor感谢您的反馈,但不幸的是我仍然得到同样的错误 – 2014-11-04 09:42:27
http://jsfiddle.net/pkxjmv9q/1/代码中的一些修正:对应该工作现在正确。 – SilentTremor 2014-11-04 13:28:41