문제

I'm using simplemodal 1.4.4 with jQuery 1.10.2 and am getting 'Not implemented' errors in IE8. This is due to simplemodal incorrectly detecting that IE is in quirks mode and executing the 'fixIE' function that is supposed to fix issues in IE6 and IE7 but errors in IE8 (and presumably IE9+ too).

simplemodal does the following check for ieQuirks:

browser.ieQuirks = browser.msie && !$.support.boxModel;

The problem is that $.support.boxModel has been removed from jQuery 1.10 so !$.support.boxModel is always returning true.

I'm wondering what the best way to detect quirks mode is in IE so I can replace !$.support.boxModel?

도움이 되었습니까?

해결책

Latest version of Simple Modal [1.4.4] uses $.support.boxModel, [Line 239] which is not supported from Jquery 1.10.*

To resolve this problem replace following line:

// Line 240: browser.ieQuirks = browser.msie && !$.support.boxModel;

with

browser.ieQuirks = browser.msie && (document.compatMode === "BackCompat");

다른 팁

this is what jquery took away, you can insert it back in if you want to

var div = document.createElement("div");
div.style.width = div.style.paddingLeft = "1px";

document.body.appendChild( div );
jQuery.support.boxModel = div.offsetWidth === 2;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top