torsdag 16 augusti 2012

JQuery UI Dialog width issue in IE 7, solution ?!

JQuery UI Dialog width issue in IE 7, solution ?!

PROBLEM==================================================
I get a scroll bar on every dialog.  Looking at it, the content height is apparently calculated by the UI.  In FF, that is the size of the content, INSIDE the padding.  IE seems to calculate the size PLUS the padding, so there is always a scrollbar for the amount of the padding.

SOLUTION==================================================

I had this problem, and found that adding a call to height("auto") after creating the dialog seems to have done the trick for now. (Tested IE 7, Chrome, Firefox) E.g.




http://forum.jquery.com/topic/jquery-ui-dialog-size-scrollbar-issue-in-ie

ANOTHER SOLUTION==========================================

var tag = $("<div></div>");
//IE7 workaround
var w;
if (navigator.appVersion.indexOf("MSIE 7.") != -1)
    w = 400;
else
    w = "auto";

tag.html('My message').dialog({
    width: w,
    maxWidth: 600,
 
http://stackoverflow.com/a/9950298 
 

Inga kommentarer:

Skicka en kommentar