From 57c76490ec662c985ddf74e1c79e8807f9acdd33 Mon Sep 17 00:00:00 2001 From: Rob McKinnon <@digital.justice.gov.uk> Date: Fri, 5 Sep 2014 15:17:36 +0100 Subject: [PATCH] replace use of removeExpression() and setExpression() as these functions are not supported in IE8, IE9, IE10 --- src/jquery.simplemodal.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jquery.simplemodal.js b/src/jquery.simplemodal.js index 69b77f0..7598b56 100644 --- a/src/jquery.simplemodal.js +++ b/src/jquery.simplemodal.js @@ -451,10 +451,11 @@ s.position = 'absolute'; if (i < 2) { - s.removeExpression('height'); - s.removeExpression('width'); - s.setExpression('height','' + bsh + ' > ' + bch + ' ? ' + bsh + ' : ' + bch + ' + "px"'); - s.setExpression('width','' + bsw + ' > ' + bcw + ' ? ' + bsw + ' : ' + bcw + ' + "px"'); + var h = eval('' + bsh + ' > ' + bch + ' ? ' + bsh + ' : ' + bch)+'px'; + var w = eval('' + bsw + ' > ' + bcw + ' ? ' + bsw + ' : ' + bcw)+'px'; + + $(s).height( h); + $(s).width( w); } else { var te, le; @@ -477,10 +478,9 @@ te = '(' + ch + ' || ' + bch + ') / 2 - (this.offsetHeight / 2) + (t = ' + st + ' ? ' + st + ' : ' + bst + ') + "px"'; le = '(' + cw + ' || ' + bcw + ') / 2 - (this.offsetWidth / 2) + (t = ' + sl + ' ? ' + sl + ' : ' + bsl + ') + "px"'; } - s.removeExpression('top'); - s.removeExpression('left'); - s.setExpression('top', te); - s.setExpression('left', le); + + $(s).css('top', eval(te)); + $(s).css('left', eval(le)); } } });