I am using the jQuery UI dialog to present content in a new iFrame. Everything works fine, except that the parent dialog box gets a horizontal scrollbar when the dialog is displayed (IE8). I tracked the problem until the <html> element inside the iFrame is interpreted as very wide by the browser, although the only content on the page is in the iFrame in the 580px div.
I tried adding CSS to the HTML and BODY tags in the iFrame (e.g. width: 98% or width: 600 pixels) ... none of this has any effect.
The following is the opening code for the dialog box. Any suggestions?
$("a[providerId]").click(function(e) {
e.preventDefault();
var $this = $(this);
var $width = 600;
var $height = 400;
$('<iframe id="companyDetail" class="companyDetail" style="padding: 0px;" src="' + this.href + '" />').dialog({
title: $this.attr('title'),
autoOpen: true,
width: $width,
height: $height,
modal: true,
resizable: false,
autoResize: true,
overlay: {
opacity: 0.5,
background: "black"
}
}).width($width).height($height);
});
. , , , ( IE8): http://elijahmanor.com/demos/jqueryuidialogiframe/index.html